Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including generator-browser-node-module with all npm packages installed. Try it out:

var generatorBrowserNodeModule = require("generator-browser-node-module")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

generator-browser-node-module v1.4.1

Scaffold out a library for both the browser and node

generator-browser-node-module Build Status

Scaffold out a library for both the browser and node

The boilerplate repo is here.

This generator is inspired from sindresorhus/generator-nm.

The scaffolding is similar, it adds support for shipping your code to the browser using Rollup as a bundler.

Here is a great read about the choice of using rollup for libraries.


npm install -g yo
npm install -g generator-browser-node-module


First make sure you're in your project folder (mkdir my-awesome-project && cd my-awesome-project/), then run

yo browser-node-module

or just


and select Browser Node Module.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free