n-installed

2019-06-14 admin

n-installed是什么

什么是n-installed,Get a list of node binaries installed via n

n-installed使用教程帮助文档

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.

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-67301.html

文章标题:n-installed

回到顶部