⚡
Zero Dependencies
No external runtime dependencies. Lightweight and fast with a small bundle size.
Beautiful, fast, and customizable code highlighting for the modern web
Install Codeshine via npm:
npm install @oxog/codeshineUse it in your project:
import { highlight } from '@oxog/codeshine'; const code = `function greet(name) { console.log(\`Hello, \${name}!\`);}`; const html = highlight(code, { language: 'javascript', theme: 'github-dark', lineNumbers: true,}); document.getElementById('code').innerHTML = html;function processData(data) { // This line is highlighted const result = []; for (const item of data) { // These lines result.push(transform(item)); // are also } // highlighted return result;}- const oldValue = 'deprecated';+ const newValue = 'updated'; const unchanged = 'same';Highlight specific words or patterns in your code for emphasis.
Every code block can have a copy button for easy code sharing.