diff --git a/index.js b/index.js index a6bad6a..90c2e3d 100644 --- a/index.js +++ b/index.js @@ -147,10 +147,10 @@ class ChartjsNode { .then(buffer => { return new BbPromise((resolve,reject) => { var out = fs.createWriteStream(filePath); - out.on('finish', function () { + out.on('finish', () => { return resolve(); }); - out.on('error', function () { + out.on('error', () => { return reject(); }); out.write(buffer);