{"name":"npmi","version":"2.0.1-alpha","description":"Gives a simplier API to npm install (programatically installs stuffs)","main":"npmi.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/maxleiko/npmi.git"},"keywords":["npm","install","api","programatically"],"author":{"name":"Maxime Tricoire","email":"max.tricoire@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/maxleiko/npmi/issues"},"homepage":"https://github.com/maxleiko/npmi","dependencies":{"npm":"^3","semver":"^4.1.0"},"gitHead":"e8540edf495c1ce46ea1ad73d52c8b54ad2c0417","_id":"npmi@2.0.1-alpha","_shasum":"559e0e192ed3183f2115b2e516210c2ed062fef3","_from":".","_npmVersion":"3.3.12","_nodeVersion":"4.2.2","_npmUser":{"name":"leiko","email":"max.tricoire@gmail.com"},"dist":{"shasum":"559e0e192ed3183f2115b2e516210c2ed062fef3","tarball":"http://registry-npm.ywwl.com/npmi/download/npmi-2.0.1-alpha.tgz","integrity":"sha512-fwVEmgaObNwG2NQwMLKWzpDVymQZ3KmAix3RvG4aHWzW/HTlE9ST+MN8TZFKOxX7wNDyqok1zA37ySh/4EDPjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDE4u8IrC4TX1og4ldLbVTuHNmvil/67CgsviK+Y1SJRgIhAJK7nFM0faAm9Kkvq9pBQlqvrerMuARA/5vFztir3tmD"}],"size":4561,"noattachment":false,"key":"/npmi/-/npmi-2.0.1-alpha.tgz"},"maintainers":[{"name":"leiko","email":"max.tricoire@gmail.com"}],"directories":{},"readme":"npmi [![Build Status](https://travis-ci.org/maxleiko/npmi.svg)](https://travis-ci.org/maxleiko/npmi)\n====\nNodeJS package that gives a simplier API to npm install (programatically installs things)\n\n[![NPM](https://nodei.co/npm/npmi.png?downloads=true&downloadRank=true)](https://nodei.co/npm/npmi/)\n\n### npmi versions scheme\n - **^1**: uses `npm@^2`\n - **^2**: uses `npm@^3`\n - **^3**: uses `npm@^5`\n - **^4**: uses [`global-npm`](https://github.com/dracupid/global-npm) (meaning `npm` is no longer a dependency of `npmi`)\n\n> :warning: Be advised that `npm` in its `v5+` will symlink local modules from the destination directory to the actual module directory instead of \"installing\" them old-school style (which is a breaking change regarding the previous npm versions)\n\n### Options\n#### options.name\n__Type:__ `String`\n__Optional:__ `true`\n\nIf you don't specify a `name` in options, but just a `path`, __npmi__ will do the same as if you were at this path in a terminal and executing `npm install`  \nOtherwise, it will install the module specified by this name like `npm install module-name` does.\n\n#### options.version\n__Type:__ `String`\n__Optional:__ `true`\n__Default__ `'latest'`\n\nDesired version for installation\n\n#### options.path\n__Type:__ `String`\n__Optional:__ `true`\n__Default__ `'.'`\n\nDesired location for installation (note that if you specified /some/foo/path, __npm__ will automatically create a `node_modules` sub-folder at this location, resulting in `/some/foo/path/node_modules`). So don't specify the `node_modules` part in your path\n\n#### options.forceInstall\n__Type:__ `Boolean`\n__Optional:__ `true`\n__Default__ `false`\n\nIf true, __npmi__ will install `options.name` module even though it has already been installed.  \nIf false, __npmi__ will check if the module is already installed, if it is, it will also check if the installed version is equal to `options.version`, otherwise, it will install `options.name@options.version`\n\n#### options.localInstall\n__Type:__ `Boolean`\n__Optional:__ `true`\n__Default__ `false`\n\nAllows __npmi__ to install local module that are not on __npm registry__. If, you want to install a local module by specifying its full path in `options.name`, you need to set this to `true`.\n\n#### options.npmLoad\n__Type:__ `Object`\n__Optional:__ `true`\n__Default__ `{loglevel: 'silent'}`\n\nThis object is given to __npm__ and allows you to do some fine-grained npm configurations.  \nIt is processed by __npm__ like command-line arguments but within an Object map ([npm-config](https://www.npmjs.org/doc/misc/npm-config.html))\n\n### Usage example\n```js\nvar npmi = require('npmi');\nvar path = require('path');\n\nconsole.log(npmi.NPM_VERSION); // prints the installed npm version used by npmi\n\n\nvar options = {\n\tname: 'your-module',\t// your module name\n\tversion: '0.0.1',\t\t// expected version [default: 'latest']\n\tpath: '.',\t\t\t\t// installation path [default: '.']\n\tforceInstall: false,\t// force install if set to true (even if already installed, it will do a reinstall) [default: false]\n\tnpmLoad: {\t\t\t\t// npm.load(options, callback): this is the \"options\" given to npm.load()\n\t\tloglevel: 'silent'\t// [default: {loglevel: 'silent'}]\n\t}\n};\nnpmi(options, function (err, result) {\n\tif (err) {\n\t\tif \t\t(err.code === npmi.LOAD_ERR) \tconsole.log('npm load error');\n\t\telse if (err.code === npmi.INSTALL_ERR) console.log('npm install error');\n\t\treturn console.log(err.message);\n\t}\n\n\t// installed\n\tconsole.log(options.name+'@'+options.version+' installed successfully in '+path.resolve(options.path));\n});\n```\n\n### Acknowledgements\nThis work has been done in the context of the [HEADS Project](http://heads-project.eu/)  \n![HEADS LOGO](heads-logo.png)\n\n### Contributors\n - [lukaskollmer](https://github.com/lukaskollmer)\n - [karanjthakkar](https://github.com/karanjthakkar)\n","publish_time":1449138220570,"_cnpm_publish_time":1449138220570,"dist-tags":{"latest":"4.0.0","next":"2.0.1-alpha"}}