Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix: Return a value for view when in silent mode #178

Closed
wants to merge 1 commit into from

Conversation

stayradiated
Copy link
Contributor

When querying npm.commands.view with silent mode, instead of returning undefined we should return the result.

const npm = require('npm')

const silent = true

npm.load({ global: true }, () => {
  npm.commands.view(['npm'], silent, (err, result) => {
    if (err != null) throw err
    console.dir({ result }) // currently prints "{ result: undefined }"
  })
})

@stayradiated stayradiated requested a review from a team as a code owner March 22, 2019 07:25
@isaacs isaacs added the semver:patch semver patch level for changes label Jun 26, 2019
@isaacs isaacs mentioned this pull request Jul 1, 2019
@isaacs isaacs closed this Jul 10, 2019
@ljharb
Copy link
Collaborator

ljharb commented Jul 10, 2019

Landed in d192904d0?

@isaacs
Copy link
Contributor

isaacs commented Jul 10, 2019

That is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch semver patch level for changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants