Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/douglasduteil/ngdoc-parser
A parser of ngdoc comments to json
https://github.com/douglasduteil/ngdoc-parser
Last synced: 4 months ago
JSON representation
A parser of ngdoc comments to json
- Host: GitHub
- URL: https://github.com/douglasduteil/ngdoc-parser
- Owner: douglasduteil
- License: wtfpl
- Archived: true
- Created: 2014-08-01T22:54:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-02-23T15:27:27.000Z (almost 7 years ago)
- Last Synced: 2024-04-13T16:16:58.173Z (8 months ago)
- Language: JavaScript
- Homepage: https://gist.github.com/douglasduteil/5bff06c0fc3be08f19b6
- Size: 18.6 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ngdoc-parser [![NPM version][npm-image]][npm-url]
> Get the ngdoc data form you source comments
Extract all the ngdoc data form your sources to a big json.
## Install
```sh
$ npm install --save-dev ngdoc-parser
```## Usage
```js
var fs = require('vinyl-fs');
var path = require('path');
var through = require('through2');var ngdocParser = require('ngdoc-parser');
fs.src('./src/*.js')
.pipe(ngdocParser())
.pipe(through.obj(function(file, e, callback){
file.path = path.join(file.base, 'ngdoc-rawdata.json');
callback(null, file);
}))
.pipe(fs.dest('./out'));
```## Output example
```js
[ // Array of ngdoc comments
{
"ngdoc": "directive",
"name": "ngRepeat",
"description": "The `ngRepeat` directive instantiates a template once per item from a collection. [...]",
"animations": "[...]",
"element": "ANY",
"scope": "",
"priority": "1000",
"params": [
{
"type": {
"typeExpression": "repeat_expression",
"type": {"type": "NameExpression", "name": "repeat_expression"},
"typeList": ["repeat_expression"]
},
"name": {"name": "ngRepeat"},
"description": "The expression indicating how to enumerate a collection. [...]"
}
]
},
// ...
]
```## API
### ngdocParser()
TODO
## Demo
```sh
npm run demo
```[demo result](https://gist.github.com/douglasduteil/5bff06c0fc3be08f19b6)
## License
Copyright © 2014 Douglas Duteil
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENCE file for more details.[npm-url]: https://npmjs.org/package/ngdoc-parser
[npm-image]: http://img.shields.io/npm/v/ngdoc-parser.svg