2.0.0 • Published 8 years ago

ng-parse-module v2.0.0

Weekly downloads
206
License
MIT
Repository
github
Last release
8 years ago

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.