2.0.0 • Published 9 years ago
ng-parse-module v2.0.0
ng-parse-module 
Small utility to read/write Angular module creation calls.
Example
var ngParseModule = require('ng-parse-module');
//read module from file
var results = ngParseModule('app.js');
//update module dependencies and rewrite
results.dependencies.modules.push('\'newDependency\'');
results.dependencies.modules.push('require(\'newDependency2\')');
results.save();API
ngParseModule(file)
Parses the file and returns an object the following properties:
file- Name of the file parsed.name- Name of the Angular module.dependencies- Object containingstart,end, andmodulesproperties.contents- Contents of the file parsed.save- Function that will rewrite the parsed file with any changes thedependencies.modulesproperty reflected in the new source.
Releases
v2.0.0 - 7/27/2016 - Updated API to allow for require() statements in module dependencies. You are also now required to add the quotes to the new dependencies you add to the array.