node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


http server to remote bundle a javascript program using browserify


bundle up your javascripts: a minimal HTTP API for browserify

npm install snuggie

snuggie is an http server

var snuggie = require('snuggie')
snuggie(httpPort, onListeningCallback)


var snuggieHandler = require('snuggie').handler


var snuggie = require('snuggie').handler
require('http').createServer(function(req, res) {
  snuggie(req, function(err, bundle) {})

first you must make a PUT/POST request to snuggie where your request upload body contains an ascii a javascript program (no multipart form uploads allowed)

then snuggie will use browserify to bundle your program and send you back a bundle. any node module available to your node server will be available to snuggie

e.g. :

  var request = require('request'){url: "http://snuggieserver:8000", body: "var foo = require('util')", json: true}).pipe(process.stdout)

the http response will be either:

{"bundle": "// browserified bundle output contents"}


{"error": "// syntaxError or moduleMissing", "message": "// a hopefully helpful error message"}

you can also just pass a function string and a callback:

snuggie.bundle(funcString, function(err, bundle) {})

npm test runs the server side tests. to test that CORS works okay run node browser-test.js and then open up localhost:8080 in a browser