0.2.8 • Published 10 years ago

reliable-npm v0.2.8

Weekly downloads
7
License
MIT
Repository
github
Last release
10 years ago

reliable-npm

NPM version build status Test coverage node version npm download

reliable npm

Installment

$ npm i reliable-npm --save

Usage

// normal usage

var npm = require('reliable-npm');

npm.install({
  cwd: '.',
}, function(error, data) {
  if (error) {
    console.log(error);
    return;
  }
  console.log(data);
});

// use in co, for a yield syntax instead of callback function implement

try {
  var data = yield npm.install({
    cwd: '.',
  });
  console.log(data);
} catch(e) {
  // e maybe `null`
  console.log(e);
}

// use as a promise

npm.install({
  cwd: '.'
})
.then(function(data) {
  console.log(data);
})
.catch(function(e) {
  console.log(e);
});

// for a custom config

var NPM = require('reliable-npm').NPM;
var npm = new NPM({
  registry: 'https://other.npmjs.org'
});

License

The MIT License (MIT)

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago