UNPKG

sardines

Version:

Combine all node.js scripts into one file. Run it as a single executable, or online.

32 lines (31 loc) 2.41 kB
{ "name": "sardines", "descriptions": "Stress-free javascript source combining.", "version": "0.4.5", "author": { "name": "Craig Condon", "email": "craig@crcn.com" }, "bin": { "sardines": "./bin/sardines" }, "repository": { "type": "git", "url": "http://github.com/crcn/sardines.git" }, "main": "./lib/index.js", "dependencies": { "ejs": "0.8.x", "optimist": "0.3.x", "outcome": "0.0.x", "step": "0.0.x", "amdify": "0.0.x", "structr": "0.2.x", "underscore": "1.4.x", "uglify-js": "1.3.x" }, "readme": "## What is it?\n\nCombine all node.js scripts into one file. Run it as a single executable, or online.\n\n## Features\n\n- Combine all scripts into one (shrinkwrap method)\n- Asynchronously load all scripts (browserify method)\n- express middleware\n\n### JS Example\n\n```javascript\nvar sardines = require(\"sardines\"),\nfs = require(\"fs\");\n\nsardines.shrinkwrap({\n\tentry: __filename\n}, function(err, content) {\n\tfs.writeFile(__dirname + \"/shrinkwrapped.js\", content);\n});\n```\n\n### Express example\n```javascript\nvar server = require(\"express\").createServer();\nserver.use(require(\"sardines\").middleware({\n\tdirectory: __dirname + \"/public\"\n}));\nserver.listen(8080);\n```\n\nIn your browser, load a script and append one of the following query arguments: `shrinkwrap`, `browserify`, or `wrap`.\n\nLike so:\n\n```bash\nhttp://localhost:8080/js/app.js?browserify # asynchronously loads ALL scripts vs loading into one\nhttp://localhost:8080/js/app.js?shrinkwrap # loads all scripts into one\nhttp://localhost:8080/js/app.js?wrap # wraps the script in a function so it doesn't pollute the global namespace\n```\n\n## Terminal Usage\n\n```bash\n\nUsage: sardines [include] -e [entry] -o [output] -p [port] -d -s\n\nOptions:\n -s, --server run the http server \n -d, --directory public directory for http server [default: cwd]\n -p, --port [default: 8080]\n -m --method [default: \"shrinkwrap\"]\n```\n\n\n## Terminal Examples\n\n```bash\nsardines -e app.js -o app.shrinkwrap.js -m shrinkwrap # shrinkwrap the app\nsardines -s # start the server\n```\n", "_id": "sardines@0.4.3", "description": "Combine all node.js scripts into one file. Run it as a single executable, or online.", "_from": "sardines" }