How to use the teraslice.saveAsset function in teraslice

To help you get started, we’ve selected a few teraslice 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 terascope / teraslice / packages / teraslice-worker / lib / execution-context / assets.js View on Github external
await Promise.map(idArray, async (assetIdentifier) => {
            const downloaded = await fs.pathExists(path.join(assetsDirectory, assetIdentifier));
            // need to return the id to the assets array sent back
            if (downloaded) return { id: assetIdentifier };

            const assetRecord = await this.assetStore.get(assetIdentifier);
            logger.info(`loading assets: ${assetIdentifier}`);
            const buff = Buffer.from(assetRecord.blob, 'base64');
            return saveAsset(logger, assetsDirectory, assetIdentifier, buff);
        });

teraslice

Distributed computing platform for processing JSON data

Apache-2.0
Latest version published 4 days ago

Package Health Score

70 / 100
Full package analysis

Similar packages