
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A react component that integrates highlight.js with advance. See examples on Codepen or Storybook.
$ npx create-react-app demo
$ cd demo
$ npm i highlight.js react-kode
Open src/index.js
import React from 'react';
import ReactDOM from 'react-dom';
// Import theme stylesheet.and react-kode
import 'highlight.js/styles/solarized-dark.css';
import Kode from 'react-kode';
const html = `
<html>
<div class="navbar">
<a href="#">Go</a>
</div>
</html>
`;
const App = () => (
<div>
<Kode
lang="html"
isEnableLineNumber={true}
>
{html}
</Kode>
</div>
);
ReactDOM.render(<App />, document.getElementById('root'));
Install react-kode.
# Install dependencies.
$ npm i react highlight.js
# Install react-kode.
$ npm i react-kode
<!--
highlight.js
https://highlightjs.org/download/
-->
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/default.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js"></script>
<!--
React
https://reactjs.org/docs/cdn-links.html
-->
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<!--
react-kode
-->
<script crossorigin src="https://unpkg.com/react-kode@latest/dist/react-kode.js"></script>
| Property | Type | Description |
|---|---|---|
| lang | string | Specify language of code. e.g. html, javascript. To get language list reference highlight.js docs or github |
| isEnableLineNumber | bool | Set true to enable line number. |
| initialLineNumber | number | Set initial number of line. |
| diff | object | Coming soon... |
# Build
$ npm run build
# Dev
$ npm run storybook
FAQs
React Component of code-block in HTML with highlight.js
We found that react-kode 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.