npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

electron-mksnapshot

v31.7.5

Published

Electron version of the mksnapshot binary

Downloads

3,186

Readme

Electron mksnapshot

Test npm: js-standard-style license:mit dependencies:?

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 for China
ELECTRON_MIRROR="https://npm.taobao.org/mirrors/electron/"

# Local mirror
# Example of requested URL: http://localhost:8080/1.2.0/mksnapshot-v1.2.0-darwin-x64.zip
ELECTRON_MIRROR="http://localhost:8080/"

Overriding the version downloaded

The version downloaded can be overriden by setting the ELECTRON_CUSTOM_VERSION environment variable.

# Install mksnapshot for Electron v8.3.0
ELECTRON_CUSTOM_VERSION=8.3.0 npm install

Generating snapshots for ARM hardware

If you need to generate snapshots for Linux on 32 bit ARM, Linux on ARM64, or Windows on ARM64 you will need to install a cross arch mksnapshot on an Intel x64 machine. To do so, set the npm config arch to the proper arch and then run npm install --save-dev electron-mksnapshot. For example:

Linux on ARM64

From an Intel x64 Linux OS run:

npm config set arch arm64
npm install --save-dev electron-mksnapshot

Linux on 32 bit ARM

From an Intel x64 Linux OS run:

npm config set arch armv7l
npm install --save-dev electron-mksnapshot

Windows on ARM (64-bit)

From an Intel x64 Windows OS run:

npm config set arch arm64
npm install --save-dev electron-mksnapshot

macOS on ARM64

On macOS you can either run the cross arch mksnapshot directly on arm64 hardware or if you wish you can generate the snapshot on an Intel X64 macOS hardware via the following:

npm config set arch arm64
npm install --save-dev electron-mksnapshot
npm run mksnapshot ABSOLUTE_PATH_TO_FILE/file.js -- --output_dir ABSOLUTE_PATH_TO_OUTPUT_DIR