node-comments-parser
Description
This scripts extracts comments from JavaScript code. It's built on esprima.
Example
This script will transform example.js:
'use strict'; /** * Class description * @class Test * @constructor */ { } Testprototype = /** * * @param */ { console; }; moduleexports = Test;
to Object:
Installation
Install with npm:
npm install node-comments-parser
Usage
var fs = ;var parser = ; var source = fs;var comments = ; // Test parsed datato;
Options
parser(options:Object):
Name | Default | Description |
---|---|---|
addEsprimaInfo | false | Add esprima parser data to a comment |
parseJsDocTags | true | If false jsdoc tags processed as text |
hideJsDocTags | true | If parseJsDocTags is true remove tags from lines property |
trim | true | Trim lines, values: true, false, 'right' |
License
Licensed under MIT.