0.2.8 • Published 8 years ago

reliable-npm v0.2.8

Weekly downloads
7
License
MIT
Repository
github
Last release
8 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

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago