Skip to content

Commit

Permalink
fix node 10 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
schnittstabil committed May 11, 2018
1 parent 9d97f4f commit 2841594
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ exports.createWriteStream = fs.createWriteStream.bind(fs);
exports.createReadStream = (path, options) => new Promise((resolve, reject) => {
const read = fs.createReadStream(path, options);

read.on('error', err => {
read.once('error', err => {
reject(new CpFileError(`Cannot read from \`${path}\`: ${err.message}`, err));
});

read.on('readable', () => {
read.once('readable', () => {
resolve(read);
});

read.on('end', () => {
read.once('end', () => {
resolve(read);
});
});
Expand Down

0 comments on commit 2841594

Please sign in to comment.