Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/ng-add-dep
Add a module dependency to an Angular module
https://github.com/dustinspecker/ng-add-dep
Last synced: 2 days ago
JSON representation
Add a module dependency to an Angular module
- Host: GitHub
- URL: https://github.com/dustinspecker/ng-add-dep
- Owner: dustinspecker
- License: mit
- Created: 2015-01-30T00:01:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T20:11:00.000Z (over 7 years ago)
- Last Synced: 2024-11-01T09:17:59.421Z (7 days ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng-add-dep [![NPM version](https://badge.fury.io/js/ng-add-dep.svg)](http://badge.fury.io/js/ng-add-dep) [![Build Status](https://travis-ci.org/dustinspecker/ng-add-dep.svg)](https://travis-ci.org/dustinspecker/ng-add-dep) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/ng-add-dep.svg)](https://coveralls.io/r/dustinspecker/ng-add-dep?branch=master)
[![Code Climate](https://codeclimate.com/github/dustinspecker/ng-add-dep/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/ng-add-dep) [![Dependencies](https://david-dm.org/dustinspecker/ng-add-dep.svg)](https://david-dm.org/dustinspecker/ng-add-dep/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/ng-add-dep/dev-status.svg)](https://david-dm.org/dustinspecker/ng-add-dep/#info=devDependencies&view=table)> Add a module dependency to an Angular module
## Usage
```javascript
var ngAddDep = require('ng-add-dep')
, fs = require('fs');/* module.js
angular
.module('module', [
]);
*/
var fileContents = fs.readFileSync('module.js');fileContents = ngAddDep(fileContents, 'child');
/* =>
angular
.module('module', [
'child'
]);
*/fileContents = ngAddDep(fileContents, 'child2');
/* =>
angular
.module('module', [
'child',
'child2'
]);
*/fileContents = ngAddDep(fileContents, 'child');
// doesn't add duplicate dependencies
/* =>
angular
.module('module', [
'child',
'child2'
]);
*/
```## License
MIT