$ npm install global-packages
List global Node packages easily.
Simply install the package:
npm install --save global-packages
After that, load it:
const globalPackages = require('global-packages')
let packages
try {
packages = await globalPackages()
} catch (err) {
console.error(err)
return
}
console.log(packages)
This is how the output will look like:
[
{
name: 'args',
linked: true,
path: '/usr/local/lib/node_modules/args'
},
{
name: 'now',
linked: false,
path: '/usr/local/lib/node_modules/now'
},
{
name: 'serve',
linked: false,
path: '/usr/local/lib/node_modules/serve'
},
...
]
npm link
npm start
npm link global-packages
and load it!Leo Lamprecht (@notquiteleo) - â–²ZEIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE