JSPM

n-installed

2.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q12561F
  • License MIT

Get a list of node binaries installed via n

Package Exports

  • n-installed

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (n-installed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status downloads npm Code Climate Test Coverage dependencies

n-installed

Get a list of node binaries installed via n

Installation

npm install --save n-installed

Summary

n-installed exports a function that returns an object with a node property and an io property, where each is an array of binary version installed via n. For instance, on my machine, this function returns:

{
  node: ['0.10.41', '0.12.9', '4.2.4', '5.4.0'],
  io: ['1.8.4', '2.5.0', '3.3.1'],
  all: ['0.10.41', '0.12.9', '1.8.4', '2.5.0', '3.3.1', '4.2.4', '5.4.0']
}

Usage

n-installed has both synchronous and asynchronous modes. Just pass a callback for async.

// Sync
var installed = require('n-installed');
var versions = installed();

// Async
installed(function(err, versions) {

});

This library uses the N_PREFIX environment variable to find binaries. If for some reason that would be unreliable in your environment, you can pass the location of the n install as the first parameter.

// Sync
var versions = installed('other/path/to/n');

// Async
installed('other/path/to/n', function(err, versions) {

});

Contributing

Please see the contribution guidelines.