diff options
author | Kat Marchán <kzm@sykosomatic.org> | 2017-05-31 09:03:47 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-31 09:03:47 +0300 |
commit | acbe85bfc1a68d19ca339a3fb71da0cffbf58926 (patch) | |
tree | 08524100ea99a972272563021448573ddc5b7f31 /lib/view.js | |
parent | dc2823a6c5fc098041e61515c643570819d059d2 (diff) |
view: wait until write completes to call cb (#16791)
Fixes: https://github.com/npm/npm/issues/16780
PR-URL: https://github.com/npm/npm/pull/16791
Credit: @zkat
Reviewed-By: @iarna
Diffstat (limited to 'lib/view.js')
-rw-r--r-- | lib/view.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/view.js b/lib/view.js index 733cf60e5..2f06aea62 100644 --- a/lib/view.js +++ b/lib/view.js @@ -300,9 +300,7 @@ function printData (data, name, cb) { log.disableProgress() // print directly to stdout to not unnecessarily add blank lines - process.stdout.write(msg) - - cb(null, data) + process.stdout.write(msg, () => cb(null, data)) } function cleanup (data) { if (Array.isArray(data)) { |