# ng-parse-module

> Small utility to read/write Angular module creation calls.

Latest version **2.0.0** (published 2016-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-parse-module
pnpm add ng-parse-module
yarn add ng-parse-module
bun add ng-parse-module
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2016-07-28 |
| First published | 2014-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Chris Gross |
| Maintainers | cgross |
| Keywords | angular, parse |

## Links

- npm: https://www.npmjs.com/package/ng-parse-module
- Repository: https://github.com/cgross/ng-parse-module
- Issues: https://github.com/cgross/ng-parse-module/issues
- npm.io page: https://npm.io/package/ng-parse-module

## Dependencies (2)

- [esprima](https://npm.io/package/esprima.md) ~1.0.4
- [underscore](https://npm.io/package/underscore.md) ~1.6.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2016-07-28
- 0.1.0 — 2014-03-25

## README

# ng-parse-module [![Build Status](https://travis-ci.org/cgross/ng-parse-module.png?branch=master)](https://travis-ci.org/cgross/ng-parse-module)

> Small utility to read/write Angular module creation calls.

## Example

```js
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.

---
_Source: https://npm.io/package/ng-parse-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
