Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@babel/highlight
Advanced tools
The @babel/highlight package is a syntax highlighter for JavaScript code. It can be used to highlight JavaScript syntax with themes for readability, often for displaying code in documentation or web applications.
Syntax highlighting
This feature allows you to highlight JavaScript code. You can pass in a string of code and an options object to specify the theme, and it returns an object with a 'value' property containing the highlighted code.
const { highlight } = require('@babel/highlight');
const code = 'const x = 1;';
const highlightedCode = highlight(code, { theme: 'default' }).value;
Prism is a lightweight, extensible syntax highlighter, built with modern web standards in mind. It's used in thousands of websites, including some of those made by big companies like USA Today and The Washington Post. It is similar to @babel/highlight but supports a wider range of languages and has a plugin system for extending functionality.
Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with many languages and has a number of different styles. It is similar to @babel/highlight in that it highlights code syntax, but it has a broader language support and different themes.
Shiki is a beautiful syntax highlighter powered by the same syntax engine that powers VS Code. It offers a high level of accuracy and a wide range of themes from VS Code. It is similar to @babel/highlight in providing syntax highlighting, but it uses TextMate grammars for language definitions and has VS Code's themes.
Syntax highlight JavaScript strings for output in terminals.
See our website @babel/highlight for more information.
Using npm:
npm install --save-dev @babel/highlight
or using yarn:
yarn add @babel/highlight --dev
v7.25.7 (2024-10-02)
babel-helper-validator-identifier
babel-traverse
babel-plugin-transform-classes
super()
check (@nicolo-ribaudo)babel-generator
infer
in compact mode (@nicolo-ribaudo)[no LineTerminator here]
after nodes (@nicolo-ribaudo)babel-types
babel-core
--experimental-require-module
(@nicolo-ribaudo)babel-helper-compilation-targets
, babel-helper-plugin-utils
, babel-preset-env
babel-plugin-proposal-destructuring-private
, babel-plugin-syntax-decimal
, babel-plugin-syntax-import-reflection
, babel-standalone
babel-generator
[no LineTerminator here]
before nodes (@nicolo-ribaudo)babel-plugin-transform-typescript
babel-types
BABEL_TYPES_8_BREAKING
at startup (@nicolo-ribaudo)FAQs
Syntax highlight JavaScript strings for output in terminals.
The npm package @babel/highlight receives a total of 0 weekly downloads. As such, @babel/highlight popularity was classified as not popular.
We found that @babel/highlight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.