List global node packages
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.npmrc
.travis.yml
index.js
license.md
package.json
readme.md
test.js

readme.md

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