Giter Club home page Giter Club logo

bankai's Introduction

bankai

Streaming {js,html,css} compiler

Philosophy

Building things takes time. Configuring tooling takes time. We believe that by taking modular tools, and wrapping them in a zero-configuration package we can help people iterate faster and produce better results. And once people are deep enough into a project that they might need something different, we make sure they can easily create their own tooling from the components we use.

Usage

  $ bankai [options] <command>

  Commands:

    <default>                      run 'bankai start'
    start <filename>               start a bankai server
    build <filename> <directory>   compile and export files to a directory
    inspect <filename>             visualize the dependency tree

  Options:

    -a, --assets=<directory>  serve static assets [assets]
    -A, --address=<ip>        ip address to listen [localhost]
    -c, --css=<subargs>       pass subarguments to sheetify
    -d, --debug               include sourcemaps [false]
    -e, --electron            enable electron mode for the bundler [false]
    -h, --help                print usage
    -H, --html=<subargs>      pass subarguments to create-html
    -j, --js=<subargs>        pass subarguments to browserify
    -o, --open=<browser>      open html in a browser [system default]
    -p, --port=<n>            bind bankai to a port [8080]
    -V, --verbose             include debug messages [false]
    -w, --watch <bool>        toggle watch mode [true]

  Examples:

    Start bankai on port 8080
    $ bankai index.js -p 8080
    Open html in the browser
    $ bankai start index.js --open
    Use brfs as a browserify transform
    $ bankai start -j [ -t brfs ] index.js
    Compile and export to dist/
    $ bankai build index.js dist/

API

assets = bankai(entryFile, [opts])

Create a new instance of bankai. The first argument is a route to the entry file that is compiled by browserify. The second argument is optional and can take the following options:

  • opts.js: (default: {}). Pass options to browserify. Cannot be disabled
  • opts.css: (default: {}). Pass options to sheetify. Set to false to disable
  • opts.html: (default: {}). Pass options to create-html. Set to false to disable
  • opts.watch: Disable livereload scripts
  • opts.electron: (default false). Enable electron mode for the bundler. Relies on index.html being served as a static file using file:// to ensure require() paths are resolved correctly
  • opts.assert: (default: true) disable all calls to require('assert')

readableStream = assets.js([req], [res])

Return a js stream. Sets correct header values if req and res are passed. Uses browserify and watchify under the hood.

readableStream = assets.html([req], [res])

Return a html stream. Sets correct header values if req and res are passed. Uses create-html under the hood.

readableStream = assets.css([req], [res])

Return a css stream. Sets correct header values if req and res are passed. Uses sheetify under the hood.

readableStream = assets.static([req], [res])

Return a static stream. Don't set any header. Useful to serve static assets like images, icons, fonts, etc. Uses send under the hood.

Installation

$ npm install bankai

See Also

Similar Packages

License

MIT

bankai's People

Watchers

 avatar  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.