ng-parse-module

Small utility to read/write Angular module creation calls.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
ng-parse-module
512.0.08 years ago10 years agoMinified + gzip package size for ng-parse-module in KB

Readme

ng-parse-module Build Status
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 containing start, end, and modules properties. - contents - Contents of the file parsed. - save - Function that will rewrite the parsed file with any changes the dependencies.modules property 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.