0.2.0 • Published 10 years ago

autonpm v0.2.0

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

autonpm

Use npm in scripts without package.json

Install

npm install autonpm

API

var autonpm = require("../index.js");

autonpm("blahblahblah123")
    .then(null, function (error) {
        console.log(error)
    })
    .done();

autonpm("arrows")
    .then(function (module) {
        console.log(module._.compile("(x,y) => x + y")(1,2));
    })
    .done();

Apart from module name, you can pass a config object

  • config.where -- for an alternate location of node_modules folder
  • config.logger -- logging

Security

  • Be wary
  • if sudo is used, uid is set back to the original user so that malicious scripts don't go root