Socket
Socket
Sign inDemoInstall

piping-browser

Package Overview
Dependencies
69
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    piping-browser

Keep your code piping hot! Rebuild your client side code on change without binaries


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
7.03 MB
Created
Weekly downloads
 

Readme

Source

Piping-browser

There are already wrappers such as brunch that offer to watch and rebuild all your client side files, and optionally launch a server for you. I wanted to launch my server and have it watch my client files and rebuild them (as well as itself, see piping)

Piping-browser uses browserify to package up your client side modules using commonjs. Browserify also gives us sourcemaps and support for node modules for free!

Installation

npm install piping-browser

Usage

Piping-browser is not a binary, so you can continue using your current workflow for running your application ("wooo!"). Basic usage is as follows:

require("piping-browser")({main:"./client/scripts/main.js",out:"./public/application.js"});

Options

  • main (path): The path to the entry point of your application. this file is automatically executed on load. Relative to the file where piping-browser was required
  • out (path): The path to where you want your bundled code to be written to. Relative to the file where piping-browser was required
  • ignore (regex): Files/paths matching this regex will not be watched. Defaults to /(\/\.|~$)/
  • watch (boolean): Whether or not piping should rebuild on changes. Defaults to true, could be set to false for production
  • debug (boolean): Whether browserify should run in debug mode or not. Debug mode turns on source maps. Defaults to true
  • minify (boolean): Whether browserify should minify output with UglifyJS. Source maps for minified output are currently not working right, and are mostly disabled regardless of debug option.
  • vendor (object): Specify configuration for building vendor files. Vendor files are concatenated in order and then minified if minify is true, and written to the given path.
    • path (string): Directory where vendor files are located, relative to file where piping-browser was required
    • out (string): Path where vendor ouput should be written, relative to the file where piping-browser was required
    • files (array): Array of vendor files, relative to vendor path.
  • build (object): An object that maps file extensions, eg "coffee" to functions that take a filename and the files data and compiles it to javascript. By default can compile coffeescript files, with sourcemaps.

Piping-browser can also be used just by passing two strings. In this case, the strings are taken as the main and out options

require("piping-browser")("./client/scripts/main.js","./public/application.js");

piping-browser plays nice with piping. To use it, ensure piping-browser is required when piping returns false:

if(!require("piping")()){
  require("piping-browser")("./client/scripts/main.js","./public/application.js");
  return;
}
// application logic here

Keywords

FAQs

Last updated on 31 Mar 2013

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc