ng-mod-get-names
Get module names from an Angular file's contents
Install
npm install --save ng-mod-get-names
Usage
ES2015
;; // file.js// angular.module('app', ['ngRoute']);// angular// .module('test')// .service(....);const jsFileContents = fs; ;// => ['app', 'test']; // file.coffee// angular.module 'app', ['ngRoute']// angular// .module 'test'// .service ....const coffeeFileContents = fs; ;// => ['app', 'test'];
ES5
var fs = ;var ngModGetNames = ; // file.js// angular.module('app', ['ngRoute']);// angular// .module('test')// .service(....);var jsFileContents = fs; ;// => ['app', 'test']; // file.coffee// angular.module 'app', ['ngRoute']// angular// .module 'test'// .service ....var coffeeFileContents = fs; ;// => ['app', 'test'];
API
ngModGetNames(fileContents)
fileContents
Type: string
File contents to analyze for module names.
LICENSE
MIT © Dustin Specker