Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@shikijs/langs
Advanced tools
@shikijs/langs is a package that provides language definitions for syntax highlighting in the Shiki code highlighter. It allows users to add support for various programming languages to be highlighted in their applications.
Language Support
This feature allows users to specify which languages they want to support for syntax highlighting. The code sample demonstrates how to use the Shiki highlighter with the @shikijs/langs package to highlight JavaScript code.
const { getHighlighter } = require('shiki');
async function highlightCode() {
const highlighter = await getHighlighter({
langs: ['javascript', 'python']
});
const code = 'console.log("Hello, world!")';
const highlightedCode = highlighter.codeToHtml(code, { lang: 'javascript' });
console.log(highlightedCode);
}
highlightCode();
highlight.js is a popular library for syntax highlighting that supports a wide range of languages. It automatically detects the language of the code and applies the appropriate highlighting. Compared to @shikijs/langs, highlight.js is more established and widely used, but Shiki offers more customization and is based on VS Code's syntax highlighting.
Prism is a lightweight, extensible syntax highlighter. It is designed to be easy to customize and extend, with a focus on performance. While @shikijs/langs is used with Shiki for VS Code-like highlighting, Prism is often used for web applications and offers a variety of plugins for additional functionality.
TextMate grammars for Shiki.
MIT
FAQs
TextMate grammars for Shiki in ESM
The npm package @shikijs/langs receives a total of 399,707 weekly downloads. As such, @shikijs/langs popularity was classified as popular.
We found that @shikijs/langs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.