Gathering detailed insights and metrics for babel-plugin-add-header-comment
Gathering detailed insights and metrics for babel-plugin-add-header-comment
Gathering detailed insights and metrics for babel-plugin-add-header-comment
Gathering detailed insights and metrics for babel-plugin-add-header-comment
npm install babel-plugin-add-header-comment
Typescript
Module System
Node Version
NPM Version
75.9
Supply Chain
87
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
3,568,431
Last Day
163
Last Week
1,294
Last Month
12,800
Last Year
249,314
13 Stars
36 Commits
8 Forks
447 Watching
2 Branches
7,125 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.3
Package Id
babel-plugin-add-header-comment@1.0.3
Size
5.31 kB
NPM Version
3.6.0
Node Version
5.7.0
Cumulative downloads
Total Downloads
Last day
-29.4%
163
Compared to previous day
Last week
-49.8%
1,294
Compared to previous week
Last month
-24.8%
12,800
Compared to previous month
Last year
-33.3%
249,314
Compared to previous year
Will add a comment to the start of the transpiled code. Since transpiling via Babel is becoming one of the last steps of the build process it's handy to add some tooling around this final step. For instance could be used:
1$ npm install babel-plugin-add-header-comment
The following is an example .babelrc
file. Using the following settings the comment will be created using 3 different features:
"This string will be inserted in"
)node executeThisOutputAddedToHeader.js
)readInTheContentsOfThisFile.txt
)1{ 2 "presets": ["es2015"], 3 "plugins": [ 4 ["add-header-comment", { 5 "header": [ 6 "This string will be inserted in a comment header", 7 "!node executeThisOutputAddedToHeader.js", 8 "?readInTheContentsOfThisFile.txt" 9 ] 10 }] 11 ] 12}
Sometimes you may want to just add headers to specific files. In this case you can do the following:
1{ 2 "presets": ["es2015"], 3 "plugins": [ 4 ["add-header-comment", { 5 "files": { 6 "src/index.js": { 7 "header": [ 8 "This string will be inserted in a comment header" 9 ] 10 } 11 } 12 }] 13 ] 14}
newLineChar
- This is the newline char that should be used by the plugin. Default value: '\n'
cache
- This is a string which represents what type of operations should be cached. For instance if you wanted to cache both read and command executions you could pass in ?!
. Default value: '?'
commentStart
- This is a string which describes how the comment is started/opened. For instance if you'd like you're comment to start with /*COMMENT START
pass in 'COMMENT START'
. Default value: '*\n'
commentEnd
- This is a string which describes how the comment is ended/closed. For example if you'd like your comment to end with COMMENT END*/
pass in 'COMMENT END'
. Default value: '\n*'
commentLineStart
- A string which is the leading charachter before a comment. Default value: '* '
MIT, see LICENSE.md for details.
No vulnerabilities found.
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
branch protection not enabled on development/release branches
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-06-24
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