Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
DIY asset 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.
$ npm install bankai
const browserify = require('browserify')
const bankai = require('bankai')
const http = require('http')
const path = require('path')
const client = path.join(__dirname, 'client.js')
const assets = bankai()
const css = assets.css()
const js = assets.js(browserify, client)
const html = assets.html()
http.createServer((req, res) => {
switch (req.url) {
case '/': return html(req, res).pipe(res)
case '/bundle.js': return js(req, res).pipe(res)
case '/bundle.css': return css(req, res).pipe(res)
default: return res.statusCode = 404 && res.end('404 not found')
}
}).listen(8080)
false
. Disable livereload scripts, cache output and
optimize all bundles.Return an html
stream. Takes the following options:
js
entry point. Defaults to /bundle.js
css
entry point. Defaults to /bundle.css
Return a css
stream using sheetify.
. Takes the following options:
process.cwd()
Return a js
stream. src
is the bundle entry file. opts
are passed
directly to browserify
require()
. Defaults to bankai-app
src
from. Defaults to process.cwd()
true
$ node ./bin/ --help
DIY asset server
Usage
$ bankai <command> [options]
Commands
start Start a bankai server
build Build the application and write it to disk
Options
-e, --entry=<id> Resolve <id> from cwd and use as entry module [default: .]
Entry module is expected to export `() -> app`
-p, --port=<n> Bind bankai to <n> [default: 1337]
-o, --optimize Optimize the page and all assets served by bankai [default: false]
-b, --browse=<app> Browse the page served by bankai with <app> [default: false]
-d, --dir=<dir> Write built application files to <dir>
--html.entry=<uri> Serve client js at <uri> [default: bundle.js]
--html.css=<uri> Serve client css at <uri> [default: bundle.css]
--html.favicon Disable favicon [default: true]
--html.title Title to use for page
--html.lang Lang attribute to use [default: en]
--css.use sheetify plugins to use
--js.<opt>=<value> Pass key <opt> with <value> to browserify
Examples
$ bankai start
Started bankai for index.js on http://localhost:1337
$ bankai start --entry=basic
Started bankai for basic/index.js on http://localhost:1337
$ bankai start --port=3000
Started bankai for index.js on http://localhost:3000
$ bankai start --open
Started bankai for index.js on http://localhost:1337
Opening http://localhost:1337 with default browser
$ bankai start --open Safari
Started bankai for index.js on http://localhost:1337
Opening http://localhost:1337 with system browser
$ bankai build --dir=dist
$ bankai build --dir=dist --html.title bankai
$ bankai build --dir=dist --css.use sheetify-cssnext
$ bankai build --dir=dist --js.fullPaths=false
Projects showing exemplary usage are provided. Install root project dependencies,
example project dependencies and execute npm start
to start an example.
FAQs
The easiest way to compile JavaScript, HTML and CSS
The npm package bankai receives a total of 102 weekly downloads. As such, bankai popularity was classified as not popular.
We found that bankai demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 open source maintainers collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.