Socket
Socket
Sign inDemoInstall

bankai

Package Overview
Dependencies
Maintainers
3
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bankai

DIY development server


Version published
Weekly downloads
194
increased by158.67%
Maintainers
3
Weekly downloads
 
Created
Source

bankai stability

npm version build status test coverage downloads js-standard-style

DIY development server. Serves HTML, CSS and JS as streams. Sets proper Content-Type encodings and buffers where possible for sub-milisecond response times in production and development.

Installation

$ npm install bankai

Usage

const sheetify = require('sheetify/stream')
const wayfarer = require('wayfarer')
const browserify = require('browserify')
const bankai = require('bankai')
const http = require('http')

const router = wayfarer()
http.createServer(function (req, res) {
  router(req.url)(req, res).pipe(res)
}).listen(1337)

const html = bankai.html()
router.on('/', () => html)

const js = bankai.js(browserify, '/src/index.js', { transform: 'babelify' })
router.on('/bundle.js', () => js)

const css = bankai.css(sheetify, '/src/index.css')
router.on('/bundle.css', () => css)

API

bankai.html(opts)

Return an html stream. Cached by default. Takes the following options:

  • opts.entry: js entry point. Defaults to /bundle.js
  • opts.css: css entry point. Defaults to /bundle.css

bankai.css(sheetify, src, opts)

Return a css stream. sheetify doesn't support incremental builds yet. Cached if NODE_ENV=production. Takes the following options:

  • use: array of transforms. Empty by default.
  • basedir: project base directory. Defaults to the dir part of src.

bankai.js(browserify, src, opts)

Return a js stream. Uses watchify for incremental builds if NODE_ENV=development. src is the bundle entry file. Cached by default.

See Also

License

MIT

Keywords

FAQs

Package last updated on 24 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc