We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9d97f4f commit 2841594Copy full SHA for 2841594
fs.js
@@ -12,15 +12,15 @@ exports.createWriteStream = fs.createWriteStream.bind(fs);
12
exports.createReadStream = (path, options) => new Promise((resolve, reject) => {
13
const read = fs.createReadStream(path, options);
14
15
- read.on('error', err => {
+ read.once('error', err => {
16
reject(new CpFileError(`Cannot read from \`${path}\`: ${err.message}`, err));
17
});
18
19
- read.on('readable', () => {
+ read.once('readable', () => {
20
resolve(read);
21
22
23
- read.on('end', () => {
+ read.once('end', () => {
24
25
26
0 commit comments