Manak/npm-programmatic

npm.list callback function always returns null

Closed this issue · 6 comments

when I try promise-then type of code,

npm.list(directory)
  .then(res => console.log(res)) // it returns Unhandled rejection null
  .catch(e => console.log(e)) // it doesn't catch any error

and it just returns null in async-await code

try {
  let res = await npm.list(directory)
  console.log(res) 
} catch (e) {
  console.error(e) // null
}

It should be throw any error but it only returns null.

Manak commented

I'm going to take a look at this. Give me a while.

huan commented

I believe #17 will solve this issue, please have a look at it @Manak

Manak commented

I’m going to merge it in today

Hi, I would greatly appreciate if you could merge the fix :) Thanks for your work

Manak commented

Merged and published (v0.0.11).