stat-comment
v0.0.9
Published
A little tool to extract comments based on [acorn](https://github.com/ternjs/acorn) and [uglify-js](https://github.com/mishoo/UglifyJS2).
Downloads
5
Maintainers
Readme
stat-comment
A little tool to extract comments based on acorn and uglify-js.
Usage
Firstly, install stat-comment
as a development dependency:
npm install stat-comment --save-dev
//input.js
stat('auto.click.stat', 'click'); //Iamcomment
function stat(a, b) {
}
stat('tap'); /*tap event*/
const Stat = require('stat-comment');
const fs = require('fs');
const code = fs.readFileSync('./input.js');
Stat.parse(code);
Stat.exportReport();
open output/report.html
to see the result.
method
parse
: parse the code to get the comments and argumentsparseComments
: get the commentsexportReport
: export the default report of the resultoutput
: output the parsed result into file