electron-npm-install
v0.1.0
Published
An API to execute `npm install` inside of electron projects.
Maintainers
Readme
electron-npm-install
An API (and command-line tool) to execute npm install inside of Electron projects, configured properly to build native dependencies with the right versions of V8 and Node to work in Electron.
Installation
npm install --save electron-npm-installUsage
var install = require('electron-npm-install');
install("node_modules/my-native-dep", function(err) {
if (err) {
console.log('Installation failed.');
} else {
console.log('Installation succeeded!');
}
});API
install(pkg, done)
Run npm install where:
pkgis the path to the package to install, ornullfor current directory (default:null)optsis an options object (default:{})opts.electronis the Electron version (default: local electron'spackage.json"version")opts.archis the target architecture (default:process.arch)opts.disturlis the URL for downloading Electron headers (default:"https://atom.io/download/electron")opts.cacheis the path for the cache directory (default:"~/.electron-npm")
doneis a function called when the command has finished (default: do nothing)
