Electron mksnapshot
Simple node module to download the mksnapshot
binaries compatible with
Electron for creating v8 snapshots.
The major version of this library tracks the major version of the Electron
versions released. So if you are using Electron 2.0.x
you would want to use
an electron-mksnapshot
dependency of ~2.0.0
in your package.json
file.
Using
npm install --save-dev electron-mksnapshot
mksnapshot.js file.js (--output_dir OUTPUT_DIR).
Running mksnapshot.js will generate both a snapshot_blob.bin and v8_context_snapshot.bin files which
are needed to use custom snapshots in Electron.
If an output directory isn't specified, the current directory will be used.
(Additional mksnapshot args except for --startup_blob are supported, run mksnapshot --help to see options)
Custom Mirror
You can set the ELECTRON_MIRROR
or NPM_CONFIG_ELECTRON_MIRROR
environment variables to use a custom base URL for downloading mksnapshot zips.
ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"
ELECTRON_MIRROR="http://localhost:8080/"