Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@shikijs/engine-oniguruma
Advanced tools
@shikijs/engine-oniguruma is an npm package that provides Oniguruma regular expression engine support for the Shiki syntax highlighter. It allows for advanced syntax highlighting by leveraging the Oniguruma regex engine, which is known for its powerful and efficient pattern matching capabilities.
Syntax Highlighting
This feature allows you to perform syntax highlighting on code snippets using the Oniguruma regex engine. The code sample demonstrates how to load the Oniguruma WASM module and use the Shiki highlighter to highlight a JavaScript code snippet.
const { getHighlighter } = require('shiki');
const { loadWASM } = require('@shikijs/engine-oniguruma');
async function highlightCode() {
await loadWASM();
const highlighter = await getHighlighter({
theme: 'nord',
langs: ['javascript']
});
const code = `const x = 10;`;
const highlightedCode = highlighter.codeToHtml(code, { lang: 'javascript' });
console.log(highlightedCode);
}
highlightCode();
highlight.js is a popular syntax highlighting library that supports a wide range of languages and themes. Unlike @shikijs/engine-oniguruma, which uses the Oniguruma regex engine, highlight.js uses its own regex-based engine for pattern matching. It is easy to use and integrates well with various web frameworks.
Prism is a lightweight, extensible syntax highlighter that is used by many websites and applications. It offers a wide range of plugins and themes, and it is known for its performance and ease of use. Unlike @shikijs/engine-oniguruma, Prism does not use the Oniguruma regex engine but instead relies on its own pattern matching techniques.
CodeMirror is a versatile text editor implemented in JavaScript for the browser. It provides syntax highlighting, code folding, and many other features. While it is more of a full-fledged code editor than just a syntax highlighter, it can be compared to @shikijs/engine-oniguruma in terms of its ability to highlight code using various modes and themes.
Engine for Shiki using Oniguruma RegExp engine in WebAssembly.
MIT
FAQs
Engine for Shiki using Oniguruma RegExp engine in WebAssembly
The npm package @shikijs/engine-oniguruma receives a total of 564,173 weekly downloads. As such, @shikijs/engine-oniguruma popularity was classified as popular.
We found that @shikijs/engine-oniguruma 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.