async function update (drive, filenames = null) {
  // list target assets
  if (!filenames) {
    filenames = await drive.pda.readdir('/')
  }
  filenames = filenames.filter(v => ASSET_PATH_REGEX.test(v))

  // read and cache each asset
  for (let filename of filenames) {
    try {
      let assetType = extractAssetType(filename)
      var dataUrl = await readAsset(drive, filename)
      await sitedata.set(drive.url, assetType, dataUrl)
      events.emit(`update:${assetType}:${drive.url}`)
    } catch (e) {
      console.log('Failed to update asset', filename, e)
    }
  }
}
@description
Crawl the given site for assets.

@param {DaemonHyperdrive} drive - site to crawl.
@param {string[]?} filenames - which files to check.
@returns {Promise<void>}