ng-parse-module

2.0.0 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i ng-parse-module

Weekly Downloads

26

Version

2.0.0

License

MIT

Last publish

Collaborators

  • cgross