Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@shikijs/engine-oniguruma
Advanced tools
Engine for Shiki using Oniguruma RegExp engine in WebAssembly
@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
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 0 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.