Gathering detailed insights and metrics for babel-plugin-react-code-block
Gathering detailed insights and metrics for babel-plugin-react-code-block
npm install babel-plugin-react-code-block
Typescript
Module System
Node Version
NPM Version
65.5
Supply Chain
89.1
Quality
77.9
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
12,867
Last Day
13
Last Week
35
Last Month
124
Last Year
834
1 Stars
46 Commits
1 Forks
2 Watching
16 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
0.3.1
Package Id
babel-plugin-react-code-block@0.3.1
Unpacked Size
6.91 kB
Size
3.18 kB
File Count
6
NPM Version
6.9.0
Node Version
12.6.0
Cumulative downloads
Total Downloads
Last day
550%
13
Compared to previous day
Last week
45.8%
35
Compared to previous week
Last month
15.9%
124
Compared to previous month
Last year
97.2%
834
Compared to previous year
1
Display React functional examples with source code.
npm
1npm install babel-plugin-react-code-block
yarn
1yarn add babel-plugin-react-code-block
Create a code block component with a code
property, which will be populated by this plugin:
1import React from 'react' 2 3export default ({children, code}) => { 4 return ( 5 <div> 6 {children} 7 <code>{code}</code> 8 </div> 9 ) 10}
Note: In the above example component children is the passed in JSX that you want to render as a demo and code is the passed in JSX converted to a string so you can also print the code sample (which is run through prettier to make it look aesthetically pleasing).
In your Babel configuration include:
1module.exports = { 2 "plugins": [ 3 [ 4 "babel-plugin-react-code-block", 5 { 6 "component": "CodeBlock", 7 }, 8 ], 9 ], 10}
Note: In the above configuration change
CodeBlock
to the name of your code block component. This plugin will simply apply the transform to any JSX elements matching the component name.
Please see the code of conduct.
Please see the contributing guide.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/19 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
44 existing vulnerabilities detected
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