Skip to content

Instantly share code, notes, and snippets.

@callumlocke
Last active August 29, 2015 14:18
Show Gist options
  • Save callumlocke/2c4675abe6c364f0bcb7 to your computer and use it in GitHub Desktop.
Save callumlocke/2c4675abe6c364f0bcb7 to your computer and use it in GitHub Desktop.
Bundle up an npm module to paste inline into Node.js code
# make sure you have these installed:
npm install --global browserify uglify-js
# example command for 'chalk':
echo "var chalk = (function(){var _ref;" `echo "_ref = require('chalk');" | browserify --bare - | uglifyjs` "return _ref;}).call(this);" > bundled.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment