electron-build-env
An API (and command-line tool) to execute a command 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-build-envUsage
var build = require('electron-build-env');
build(["npm", "install"], function(err) {
if (err) {
console.log('Installation failed.');
} else {
console.log('Installation succeeded!');
}
});API
build(cmd, opts, done)
Run a command where:
cmdis the command with argumentsoptsis 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.devdiris the path for the Electron headers directory (default:"~/.electron-gyp")
doneis a function called when the command has finished (default: do nothing)