How to use the @parcel/utils.blobToStream function in @parcel/utils

To help you get started, we’ve selected a few @parcel/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github parcel-bundler / parcel / packages / core / core / src / PackagerRunner.js View on Github external
async writeToCache(cacheKey: string, contents: Blob, map: ?Blob) {
    let contentKey = getContentKey(cacheKey);

    await this.options.cache.setStream(contentKey, blobToStream(contents));

    if (map != null) {
      let mapKey = getMapKey(cacheKey);
      await this.options.cache.setStream(mapKey, blobToStream(map));
    }
  }
}
github parcel-bundler / parcel / packages / core / core / src / PackagerRunner.js View on Github external
async writeToCache(cacheKey: string, contents: Blob, map: ?Blob) {
    let contentKey = getContentKey(cacheKey);

    await this.options.cache.setStream(contentKey, blobToStream(contents));

    if (map != null) {
      let mapKey = getMapKey(cacheKey);
      await this.options.cache.setStream(mapKey, blobToStream(map));
    }
  }
}
github parcel-bundler / parcel / packages / core / core / src / InternalAsset.js View on Github external
getStream(): Readable {
    if (this.value.contentKey != null) {
      this.content = this.options.cache.getStream(this.value.contentKey);
    }

    return blobToStream(this.content);
  }