GithubHelp home page GithubHelp logo

nvdnkpr / disc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hughsk/disc

0.0 2.0 0.0 214 KB

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

Home Page: http://hughsk.github.io/disc

License: Other

disc's Introduction

disc

disc screenshot

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. It works with node projects too!

The demo included on disc's github page is the end result of running the tool on itself - displaying both the node and browser code.

Installation

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

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

Options:
  -h, --help       Displays these instructions.
  -o, --output     Output path of the bundle. Defaults to stdout.
  -t, --transform  Browserify transform stream(s) to use.
  -O, --open       Open the file immediately.

Simply specify your script entry points as you would when building a project with the browserify command-line tool - if your project uses source transforms, you should include those too, e.g:

discify -t coffeeify index.coffee

By default, disc will spit out a standalone HTML file that you can open in your browser:

discify index.js > stats.html
open stats.html

If you're looking to get a quick look at your project, you can use the --open or -O flags to start a local server and open it up in your browser automatically:

discify index.js --open

Module API

require('disc').json(files, transforms, callback)

Takes an array of files, and an array of browserify transform streams, and gathers the required data - calling callback(err, json) with either an error or the results.

require('disc').bundle(options, callback)

Calls callback(err, html) with a standalone HTML file. You can pass the following options to the function to modify the output:

  • files: the files to parse/traverse
  • footer: HTML to include below the chart.
  • transforms: transform streams to pass to module-deps.

disc's People

Contributors

hughsk avatar raynos avatar

Watchers

Navid Nikpour avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.