Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


:chart_with_upwards_trend: Visualise the module tree of browserify project bundles and track down bloat.

Subscribe to updates I use disc

Statistics on disc

Number of watchers on Github 1261
Number of open issues 22
Average time to close an issue 3 months
Main language JavaScript
Average time to merge a PR 11 days
Open pull requests 11+
Closed pull requests 3+
Last commit over 2 years ago
Repo Created almost 7 years ago
Repo Last Updated about 2 years ago
Size 282 KB
Homepage http://hughsk.io/...
Organization / Authorhughsk
Page Updated
Do you use disc? Leave a review!
View open issues (22)
View disc activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating disc for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

disc gittip: hughsk npm stable

Disc is a tool for analyzing the module tree of browserify project bundles. It's especially handy for catching large and/or duplicate modules which might be either bloating up your bundle or slowing down the build process.

The demo included on disc's github page is the end result of running the tool on browserify's own code base.


Disc lives on npm, so if you haven't already make sure you have node installed on your machine first.

Installing should then be as easy as:

sudo npm install -g disc

Command-Line Interface

Note: you'll need to build your bundle with the --full-paths flag, and pass a fully qualified (not relative) input path to browserify for disc to do its thing.

discify [bundle(s)...] {options}

  -h, --help    Displays these instructions.
  -o, --output  Output path of the bundle. Defaults to stdout.
  -O, --open    Opens disc in a new browser window automatically
  -m, --mode    the default file scale mode to display: should be
                either "count" or "size". Default: size

When you install disc globally, the discify command-line tool is made available as the quickest means of checking out your bundle. As of disc v1.0.0, this tool takes any bundled browserify script as input and spits out a standalone HTML page as output.

For example:

browserify --full-paths index.js > bundle.js
discify bundle.js > disc.html
open disc.html

You can easily chain this file into another command, or use the --open flag to open disc in your browser automatically:

browserify --full-paths index.js | discify --open

Module API

Note: you'll need to build your bundle with the fullPaths option for disc to do its thing.


Creates a through stream that you can pipe a bundle into, and get an HTML file in return much like you would expect when working with the command-line tool.

So to perform the above example with Node instead of Bash:

var browserify = require('browserify')
var open = require('opener')
var disc = require('disc')
var fs = require('fs')

var input = __dirname + '/index.js'
var output = __dirname + '/disc.html'

var bundler = browserify(input, {
  fullPaths: true

  .once('close', function() {

This method takes the following options:

  • header: HTML to include above the visualisation. Used internally to render the Fork me on GitHub ribbon.
  • footer: HTML to include beneath the visualisation. Used internally for the description on the demo page.
  • mode: the default file scale mode to display: one of either "count" or "size", defaulting to "size".

disc.bundle(bundles, [opts], callback)

A callback-style interface for disc: takes an array of bundles (note: the file contents and not the file names), calling callback(err, html) with either an error or the resulting standalone HTML file as arguments.

This currently mirrors how disc is currently implemented, but the stream API is a little more convenient to work with.

disc.json(bundles, callback)

Takes an array of bundle contents (as strings, or Buffers), and gathers the required data - calling callback(err, json) with either an error or the results.


You can switch between multiple color palettes, most of which serve to highlight specific features of your bundle:

Structure Highlights

Structure Highlights

Highlights node_modules directories as green and lib directories as orange. This makes it easier to scan for kitchen sink modules or modules with lots of dependencies.

File Types

File Types

Highlights each file type (e.g. .js, .css, etc.) a different color. Helpful for tracking down code generated from a transform that's bloating up your bundle more than expected.

Browserify Core

Browserify Core

Highlights the automatically included and/or inserted modules that come courtesy of browserify in red. Makes it easy to quantify just how much space in your bundle is the result of shimming node's core functionality.


Nothing particularly special about these palettes colored for legibility and aesthetics respectively.

disc open issues Ask a question     (View All Issues)
  • almost 4 years Update d3 to v4 modules
  • almost 4 years error "Duplicate data property in object literal not allowed in strict mode"
  • about 4 years --open does not work on Windows
  • over 4 years ES6 syntax (computed property names) causes esprima-fb error
  • over 4 years Unexpected token: ILLEGAL
  • over 4 years Flattened npm 3 installs don't display dependency hierarchies correctly
  • over 4 years Outdated dependency `bl` causing install failure
  • almost 5 years Manage external package only bundle
  • almost 5 years feature request: console reporter
  • about 5 years --open in conjunction with --output
  • over 5 years Cant pipe into discify
  • over 5 years module not resolving when using disc
  • over 5 years TypeError: Cannot read property 'source' of undefined
  • almost 6 years -r seems to break it?
  • almost 6 years webpack support?
  • almost 7 years Make filesize analysis match browserify bundling
  • almost 7 years browser vs. server
  • almost 7 years minify and gzip before checking file size
disc open pull requests (View All Pulls)
  • deps - bump bl to 0.8.0
  • Handle "external-only" bundles created with browserify -r. Fixes #41
  • Tiny README fix
  • Listen on random port rather than 12999
  • Remove protocol
  • Add rotate option
  • Update README.md
  • Updated deps, added travis ci support to ensure coverage
  • Support ES2015 parsing
  • bump bl version
  • Handle module.id being null
disc questions on Stackoverflow (View All Questions)
  • Since FireFox extensions are written in Javascript, how are they able to write to the local disc, which JS proscribes?
  • Datapump Jobs Linux Not Working After Making Disc Space
  • I am getting the error "Could not find the developer disc image". The Xcode version is Version 7.1 (7B91b)
  • Set disc quota with DeviceMapper
  • How to make a DJ disc that follows MediaPlayer and scratches in android
  • Save camera roll image to disc in react native
  • Erlang: create a disc schema
  • How to handle windows "Drive not ready", "No disc" etc alert dialog
  • How to delete unused org-mode attachment files from disc
  • DirectX C++ Disc animation
  • Newton's Disc rotation program too slow. Any way to speed up timer? Also, animation flickers. Any way to fix that?
  • Boto does not save s3 file to disc on AWS Lambda
  • Large data from SQL server to local hard disc to Tableau and Pandas
  • Combine picture with text and save to disc. (Someecards style)
  • Is there a way to discern if a drive is a dvd/cd/blueray drive without a disc inside?
  • Leveraging nx.minimum_node_cut to get all minimal sets of nodes that disc
  • Prevent Redis from saving to disc
  • How to control size of list-style-type disc in CSS?
  • Every time I clean, run, or build the project, the manifest file gets reloaded from disc
  • PHP Word, send generated file to browser as output without saving it on disc
  • Working with big data in python and numpy, not enough ram, how to save partial results on disc?
  • PyX python scripts write files to disc but not to screen
  • Docker maximize disc quota
  • Cassandra increased disc usage when updating to 2.1.9
  • How To Add List-style-type: "disc" to <p> tag
  • Erlang - Is it possible to limit the ram consumption when using disc copies in Mnesia?
  • is there an easy/efficient way to make a mysql database dynamically 'build it's own structure' as it saves name/value pairs to disc?
  • KickStart Centos Says Please insert Centos Disc 1 to Continue
  • Make ms access database trusted for all users on network disc
  • SOLR Cloud 4.3 delete data from index and disc
disc list of languages used
Other projects in JavaScript