Installations
npm install babel-plugin-add-header-comment
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
5.7.0
NPM Version
3.6.0
Score
75.9
Supply Chain
87
Quality
75.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
shopify
Download Statistics
Total Downloads
3,568,431
Last Day
163
Last Week
1,294
Last Month
12,800
Last Year
249,314
GitHub Statistics
13 Stars
36 Commits
8 Forks
447 Watching
2 Branches
7,125 Contributors
Bundle Size
1.70 kB
Minified
834.00 B
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
3,568,431
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
babel-plugin-add-header-comment
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:
- to add in license info
- add in version numbers to builds
- etc.
Installation
1$ npm install babel-plugin-add-header-comment
Example
The following is an example .babelrc
file. Using the following settings the comment will be created using 3 different features:
- Adding a hardcoded string (
"This string will be inserted in"
) - By executing a script and injecting the output (
node executeThisOutputAddedToHeader.js
) - By reading in the contents of a file (
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}
Plugin Options
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 withCOMMENT END*/
pass in'COMMENT END'
. Default value:'\n*'
commentLineStart
- A string which is the leading charachter before a comment. Default value:'* '
License
MIT, see LICENSE.md for details.
No vulnerabilities found.
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/Shopify/.github/SECURITY.md:1
- Info: Found linked content: github.com/Shopify/.github/SECURITY.md:1
- Warn: One or no descriptive hints of disclosure, vulnerability, and/or timelines in security policy
- Info: Found text in security policy: github.com/Shopify/.github/SECURITY.md:1
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
- Warn: branch protection not enabled for branch 'master'
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 1 are checked with a SAST tool
Score
3.8
/10
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