Skip to content

Commit

Permalink
do not resolve until writing is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
schristley committed Oct 18, 2024
1 parent cb34d23 commit 629f32c
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 629f32c

Please sign in to comment.