🚨 Announcing Vendure v2 Beta

AssetImportStrategy

AssetImportStrategy

Package: @vendure/core File: asset-import-strategy.ts
v1.7.0

The AssetImportStrategy determines how asset files get imported based on the path given in the import CSV or via the AssetImporter getAssets() method.

The DefaultAssetImportStrategy is able to load files from either the local filesystem or from a remote URL.

A custom strategy could be created which could e.g. get the asset file from an S3 bucket.

Signature

interface AssetImportStrategy extends InjectableStrategy {
  getStreamFromPath(assetPath: string): Readable | Promise<Readable>;
}

Extends

Members

getStreamFromPath

method
type:
(assetPath: string) => Readable | Promise<Readable>
Given an asset path, this method should return a Stream of file data. This could e.g. be read from a file system or fetch from a remote location.