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 🙏

© 2025 – Pkg Stats / Ryan Hefner

emscripten-build

v1.0.2

Published

Build a C++ WebAssembly program inside your Node.js packaging workflow.

Readme

emscripten-build

e2e-test emscripten-build mit-license

Build your C++ WebAssembly project inside your Node.js build workflow.

This package uses the Emscripten SDK to compile your C++ to WebAssembly. It provides a command line and a JS interface that allows you to configure your builds and integrate your WASM project into your packaging scripts.

How to Use

This package assumes that you have a C/C++ project that can build with Emscripten via a Makefile. The recommended usage is to run builds with CMake and Ninja. Support also exists for GNU Make and Autotools.

Building can be made as simple as switching to your project directory and entering in the command line:

npx emscripten --configure --build

or invoking from JavaScript:

const emscripten = import('emscripten-build');

emscripten.configure()
    .then((em) => em.build())
    .then((em) => { /* ... */ });

Builds are configured by placing emscripten.settings.js in your project root. Here is a simple settings file for a CMake project:

module.exports = {
    myProject: {
        type: "cmake",

        configure: {
            path: "./src",
            generator: "Ninja",
            type: "Release",
            definitions: {
                DEFINE1: "Value1"
            }
        },

        build: {
            path: "./build"
        },

        install: {
            path: "./dist"
        }
    }
};

See the end of this document for detailed guides.

Install

npm install --save-dev emscripten-build

Before you install this package, you must install Python 3.6+ on your system. You may download it at python.org or your OS's package manager.

By default, the Emscripten SDK is installed into your node_modules tree. You may specify a custom path by modifying your NPM config via one of the commands below. Do this before you install the package:

|Action|Command |------|------- | Save the path to your project .npmrc | npm config --userconfig "/your/project/root/.npmrc" set emsdk "/your/absolute/custom/path" | Save the path to your user .npmrc | npm config set emsdk "/your/absolute/custom/path" | Set an environment variable | set NPM_CONFIG_EMSDK=/your/absolute/custom/path | Use a config argument to NPM temporarily | npm [command] --emsdk="/your/absolute/custom/path"

The Emscripten SDK, CMake, and Ninja programs are installed as NPM dependencies.

See Also

For detailed information on how to use this package, see these guides:

Visit this repository to see different examples on how to use this package:

License

MIT License.