Skip to content

Commit

Permalink
do not resolve until writable is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
schristley committed Oct 18, 2024
1 parent a87eac9 commit 871cf2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lang/js/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ module.exports = function(airr) {
var writable = fs.createWriteStream(filename);
if (is_gz) writable.pipe(zlib.createGunzip());

writable.on('finish', function() {
return resolve();
});

// write header
writable.write(field_names.join('\t'));
writable.write('\n');
Expand All @@ -134,7 +138,7 @@ module.exports = function(airr) {
}

writable.end();
return resolve();
// return resolve();
});
}

Expand Down

0 comments on commit 871cf2e

Please sign in to comment.