Socket
Book a DemoInstallSign in
Socket

koa-watchify

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-watchify

Wraps a browserify or watchify instance into a koa middleware

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
2
Created
Source

koa-watchify

NPM version build status Test coverage Downloads

Wraps a browserify or watchify instance into a koa middleware.

Installation

$ npm install koa-watchify

Usage

const wreq     = require('koa-watchify')
const watchify = require('watchify')
const path     = require('path')
const koa      = require('koa')
const app      = koa()

var bundle = browserify({
  entries: [path.join(process.cwd(), 'index.js')],
  fullPaths: true,
  packageCache: {},
  cache: {}
})

if ('development' == process.env.NODE_ENV) bundle = watchify(bundle)

app.use(wreq(bundle))
app.listen(process.env.port || 1337)

Why?

Setting up boilerplate for browserify / watchify can be a bit annoying. This module provides a good entry point for both development and production servers running koa and browserify. No gulp, grunt or make needed.

Contributors

See Also

License

MIT

Keywords

koa

FAQs

Package last updated on 22 Feb 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