Skip to content

Instantly share code, notes, and snippets.

@simonmcmanus
Created March 20, 2014 15:11
Show Gist options
  • Save simonmcmanus/9665987 to your computer and use it in GitHub Desktop.
Save simonmcmanus/9665987 to your computer and use it in GitHub Desktop.
Bundled Dependencies Generator
'use strict';
/**
* Takes a look and the dependencies object and adds each item to the bundled dependencies array.
*/
var fs = require('fs');
var file = __dirname + '/../package.json';
var pkg = require(file);
pkg.bundledDependencies = Object.keys(pkg.dependencies);
fs.writeFile(file, JSON.stringify(pkg, null, 4), function(error) {
if (error) {
throw error;
}
console.log('Package.json updated with the following bundled dependencies:');
console.log(pkg.bundledDependencies);
});
@simonmcmanus
Copy link
Author

Sits in a bin folder at the same level as your package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment