Extract javascript comments on per character basis. Comment object compatible with acorn-extract-comments
and Esprima format.
Notice: It extracts only first level block comments, not include nested comments.
Install
npm i get-comments --save
npm test
Usage
For more use-cases see the tests
<input>
{String} string to extract from[resType]
{Boolean} if true, will return array, otherwise objectreturn
{Array|Object}
Example
var getComments = require('get-comments');
var input = fs.readFileSync('./fixture.js', 'utf8')
var comments = getComments(input, true)
See also
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.