Skip to content

view: directly print to process.stdout #1791

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed

Conversation

MylesBorins
Copy link
Contributor

Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: #1639

Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: npm#1639
isaacs
isaacs previously requested changes Sep 10, 2020
Copy link
Contributor

@isaacs isaacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to write '' to proces.stdout.

if (msg !== '') {
  console.log(msg.trim())
}

@MylesBorins
Copy link
Contributor Author

updated, PTAL

@MylesBorins
Copy link
Contributor Author

FWIW we probably want to modify / update the commit text when landing since it is no longer accurate

@darcyclarke darcyclarke added Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release beta labels Sep 11, 2020
ruyadorno pushed a commit that referenced this pull request Sep 16, 2020
Currently in npm 7 output of npm view is being printed
by a call to console.log which is causing an extra newline
on output compared to npm 6. Replace the call to console.log
with process.stdout.write to avoid this.

Fixes: #1639

PR-URL: #1791
Credit: @MylesBorins
Close: #1791
Reviewed-by: @ruyadorno
@ruyadorno ruyadorno closed this Sep 16, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 15 milestone Sep 25, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants