Gathering detailed insights and metrics for babel-extract-comments
Gathering detailed insights and metrics for babel-extract-comments
Uses babel to extract JavaScript code comments from a string. Returns an array of comment objects, with line, column, index, comment type and comment string.
npm install babel-extract-comments
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.3
Supply Chain
100
Quality
74.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
556,793,123
Last Day
129,072
Last Week
606,391
Last Month
3,160,251
Last Year
48,863,389
14 Stars
10 Commits
2 Forks
4 Watching
1 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
babel-extract-comments@1.0.0
Size
3.21 kB
NPM Version
5.6.0
Node Version
9.1.0
Publised On
12 Feb 2018
Cumulative downloads
Total Downloads
Last day
-8.4%
129,072
Compared to previous day
Last week
-28.9%
606,391
Compared to previous week
Last month
5.1%
3,160,251
Compared to previous month
Last year
-33.4%
48,863,389
Compared to previous year
1
2
Uses babel (babylon) to extract JavaScript code comments from a JavaScript string or file.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm:
1$ npm install --save babel-extract-comments
Add to your Node.js/JavaScript project with the following line of code:
1const extract = require('babel-extract-comments');
Extract code comments from the given string
.
Params
string
{String}: String of javascriptreturns
{Array}: Array of code comment objects.Example
1var extract = require('babel-extract-comments'); 2console.log(extract('// this is a code comment')); 3// [{ type: 'CommentBlock', 4// value: '!\n * babel-extract-comments <https://github.com/jonschlinkert/babel-extract-comments>\n *\n * 5// Copyright (c) 2014-2018, Jon Schlinkert.\n * Released under the MIT License.\n ', 6// start: 0, 7// end: 173, 8// loc: SourceLocation { start: [Position], end: [Position] } }]
Extract code comments from a JavaScript file.
Params
file
{String}: Filepath to the file to parse.options
{Object}: Options to pass to esprima.returns
{Array}: Array of code comment objects.Example
1console.log(extract.file('some-file.js'), { cwd: 'some/path' }); 2// [ { type: 'Line', 3// value: ' this is a line comment', 4// range: [ 0, 25 ], 5// loc: { start: { line: 1, column: 0 }, end: { line: 1, column: 25 } } } ]
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
1$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
1$ npm install -g verbose/verb#dev verb-generate-readme && verb
You might also be interested in these projects:
Commits | Contributor |
---|---|
4 | jonschlinkert |
1 | eventualbuddha |
Jon Schlinkert
Copyright © 2018, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on February 12, 2018.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/9 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More