Nevertheless! Party Metaphorically
    Have ideas to improve npm?Join in the discussion! »

    budo

    2.0.1 • Public • Published

    budō

    stable

    This is a browserify development server inspired by beefy and wzrd, but with a stronger focus on incremental bundling, LiveReload (including CSS injection), and other experimental features down the road.

    Note that budo needs a copy of watchify installed. It can be either local (preferred) or global.

    npm install budo watchify -g

    The simplest use cases will start up a server with a default index.html and incrementally bundle your source on filesave. Examples:

    #run watchify on port 9966 
    budo index.js
     
    #run watchify with explicit output file  
    budo index.js --outfile bundle.js --verbose
     
    #run watchify with some options and trigger LiveReload on change 
    budo index.js --live --transform brfs

    You can open localhost:9966 to see the content in action.

    To pretty-print in terminal, garnish, bistre or another ndjson-based stream can be used.

    budo index.js -o bundle.js | garnish

    See docs for more features.

    PRs/suggestions/comments welcome. Props to @caspervonb for the early groundwork.

    docs

    usage

    NPM

    CLI

    Details for budo command-line interface. Other options like --verbose and --transform are sent to browserify/watchify.

    Usage:
        budo [entries] [opts]
     
    Options:
        --outfile, -o   path to output bundle
        --port          the port to run, default 9966
        --host          the host, default "localhost"
        --dir           the directory to serve, and the base for --outfile
        --live          enable LiveReload integration
        --live-plugin   enable LiveReload but do not inject script tag
        --live-port     the LiveReload port, default 35729

    By default, the --debug option will be sent to watchify (for source maps). If this is unwanted, you can use --no-debug or --debug=false to disable source maps.

    Note: The --outfile is relative to the specified --dir.

    API

    The API mirrors the CLI except you must provide a stream for logging, and it does not attempt to auto-portfind.

    var budo = require('budo')
     
    budo('./src/index.js', {
      live: true,             //live reload
      stream: process.stdout, //log to stdout
      port: 8000              //use this port
    }).on('connnect', function(ev) {
      //...
    })

    See API usage for more details.

    Script Injection

    screenshot

    (click for demo)

    The original motivation for making budō was to build a simple tool around Chrome Script Injection. This has since split off into its own repository: budo-chrome to minimize the scope of budō.

    License

    MIT, see LICENSE.md for details.

    Install

    npm i [email protected]

    Version

    2.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar
    • avatar