global-packages

List global node packages


Keywords
global, packages, node, modules, load, global-packages, npm, package
License
MIT
Install
npm install global-packages@1.0.2

Documentation

global-packages

Build Status XO code style Slack Channel

List global Node packages easily.

Usage

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'
  },
  ...
]

Contribute

  1. Fork this repository to your own GitHub account and then clone it to your local device
  2. Link the package to the global module directory: npm link
  3. Transpile the source code and watch for changes: npm start
  4. Within the module you want to test your local development instance of global-packages, just link it to the dependencies: npm link global-packages and load it!

Author

Leo Lamprecht (@notquiteleo) - ▲ZEIT