Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@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.9 (2024-10-22)
babel-parser
, babel-template
, babel-types
syntacticPlaceholders
mode (@liuxingbaoyu)babel-helper-compilation-targets
, babel-preset-env
ClassAccessorProperty
to prevent the no-undef
rule (@victorenator)babel-parser
, babel-types
VISITOR_KEYS
etc. faster to access (@liuxingbaoyu)FAQs
Syntax highlight JavaScript strings for output in terminals.
The npm package @babel/highlight receives a total of 35,092,129 weekly downloads. As such, @babel/highlight popularity was classified as 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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.