jantimon / ng-directive-parser

Extracts angular directive information from source

Home Page:http://jantimon.github.io/ng-directive-parser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ng-directive-parser Build Status

This module uses Esprima to turn Angular Directive javascript source code into json format
A browserified version can be seen in the online demo

Getting Started

Install the module with: npm install ng-directive-parser

var ng-directive-parser = require('ng-directive-parser');
var directives = ngDirectiveParser.parseFile('directives.js');

/* Result:
[
  {
    "filename": "directive.js",
    "name": "demoDirective1",
    "replace": true,
    "transclude": true,
    "template": "<demo-directive2 data-action=\"foo\">Content</demo-directive2>",
    "restrict": {
      "A": false,
      "E": true,
      "C": false
    }
  }
]
 */

Install with cli command

$ npm install ng-directive-parser

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

License

Copyright (c) 2014 Jan Nicklas
Licensed under the MIT license.

About

Extracts angular directive information from source

http://jantimon.github.io/ng-directive-parser/

License:MIT License


Languages

Language:JavaScript 100.0%