Security News
vlt Debuts New JavaScript Package Manager and Serverless Registry at NodeConf EU
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
react-highlight
Advanced tools
React component for syntax highlighting using highlight.js
npm install react-highlight --save
var Highlight = require('react-highlight');
Choose the theme for syntax highlighting and add corresponding styles of highlight.js
<link rel="stylesheet" href="/path/to/styles/theme-name.css">
The styles will most likely be in node_modules/highlight.js/styles
folder.
Code snippet that requires syntax highlighting should be passed as children to Highlight component in string format. Language name of code snippet should be specified as className.
<Highlight className='language-name-of-snippet'>
{"code snippet to be highlighted"}
</Highlight>
Set innerHTML=true
to highlight multiple code snippets at a time.
This is especially usefull if html with multiple code snippets is generated from preprocesser tools like markdown.
Warning: If innerHTML is set to true, make sure the html generated with code snippets is from trusted source.
<Highlight innerHTML={true}>
{"html with multiple code snippets"}
</Highlight>
FAQs
React component for syntax highlighting
The npm package react-highlight receives a total of 19,072 weekly downloads. As such, react-highlight popularity was classified as popular.
We found that react-highlight demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt introduced its new package manager and a serverless registry this week, innovating in a space where npm has stagnated.
Security News
Research
The Socket Research Team uncovered a malicious Python package typosquatting the popular 'fabric' SSH library, silently exfiltrating AWS credentials from unsuspecting developers.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.