diff --git a/package.json b/package.json index a0972ed..e9275b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@swrlab/node-storage-wrapper", - "version": "0.0.6", + "version": "0.0.7", "description": "Wrapping AWS S3, GCP GCS, file storage", "main": "./src/index.js", "engines": { diff --git a/src/load.js b/src/load.js index 9815df7..dc69e50 100644 --- a/src/load.js +++ b/src/load.js @@ -9,7 +9,7 @@ const fetch = require('node-fetch'); const loadLocalFile = (that, uri) => new Promise((resolve, reject) => { - that.sdk.fs.readFile(uri, 'utf8', (err, data) => { + that.sdk.fs.readFile(uri, (err, data) => { if (err) reject(err); else resolve(data); }); @@ -68,11 +68,13 @@ module.exports = async function (uri) { return Promise.reject('fetching url failed with status > ' + file.status); } } else { + // log progress + this.sdk.log(this, 'log', ['storage.load.local >', uri]); + // local file let file = await loadLocalFile(this, uri); - this.sdk.log(this, 'log', ['storage.load.local >', uri]); - + // return file return Promise.resolve(file); } } catch (err) {