Created
March 20, 2014 15:11
-
-
Save simonmcmanus/9665987 to your computer and use it in GitHub Desktop.
Bundled Dependencies Generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sits in a bin folder at the same level as your package.json