Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
@babel/highlight
Advanced tools
Syntax highlight JavaScript strings for output in terminals.
Weekly downloads
Package description
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.
Changelog
v7.16.7 (2021-12-31)
babel-plugin-transform-runtime
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
babel-helpers
babel-helper-function-name
, babel-plugin-transform-function-name
babel-core
$schema
property in json config files (@The-x-Theorist)Readme
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
FAQs
Syntax highlight JavaScript strings for output in terminals.
The npm package @babel/highlight receives a total of 40,531,009 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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.