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

browserify-deoptimizer

v1.1.1

Published

Transforms browserify bundles into a collection of single files

Downloads

23

Readme

Split Browserify Bundles into Individual Files

Sometimes you work in browsers without //@ sourceURL or source maps. But you like using Browserify, since it's truly amazing. How will you ever debug things? With all your modules squished into one file, it's a disaster.

Enter the Browserify Deoptimizer, which will handily “de-optimize” your Browserify bundles by turning them into individual files, including files for each module you author.

Usage

You use the Browserify Deoptimizer by first creating a Browserify bundle, programmatically. Then, instead of creating a big string with bundle.bundle(), you just deoptimize it!

var browserify = require("browserify");
var deoptimize = require("browserify-deoptimizer");

var bundle = browserify({ cache: true });
bundle.alias("jquery", "jquery-browserify");
bundle.addEntry("start.js");

var deoptimized = deoptimize(bundle);

Your deoptimized variable will then look something like this:

{
  "browserify-prelude.js": 'var require = function (file, …',
  "vm": 'require.define("vm",function(r…',
  "node_modules/browserify/node_modules/vm-browserify/package.json": 'require.define("/node_modules/…',
  "node_modules/browserify/node_modules/vm-browserify/index.js": 'require.define("/node_modules/…',
  "node_modules/jquery-browserify/package.json": 'require.define("/node_modules/…',
  "node_modules/jquery-browserify/index.js": 'require.define("/node_modules/…',
  "browserify-aliases.js": 'require.alias("jquery-browseri…',
  "start.js": 'require.define("/start.js",fun…',
  "browserify-entry.js": 'require("/start.js");'
}

You can then use these module IDs to write out the wrapped files to the filesystem, and the appropriate <script> tags to your index.html.

Special Files

Since Browserify does some magic, we can't just create a single file for each of your modules. We need some magic files too. These are:

  • browserify-prelude.js: contains the definition of require and process, as well as any prepends with bundle.prepend. This will be the first file in the map.
  • browserify-aliases.js: Contains any calls to Browserify's require.alias to set up module aliases. This is inserted into the map after the entries for the aliased files themselves (e.g. after jquery-browserify's files). If there are no aliases, this file will not exist.
  • browserify-entry.js: Contains calls to require for all entry files in the bundle. If there are no entry files, this file will not exist.

Name

This package owes its name to r.js, the RequireJS optimizer, which turns multiple AMD modules into a single bundled file. Since this package does the opposite, I thought it'd be clever to name it a deoptimizer.