A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/streamich/code-colors below:

streamich/code-colors: Code syntax highlighting for the web

Code syntax highlighting for the web. Uses Prism for parsing.

Why I created this library? I needed a simple React component that highlights code, but there was none which satisfied the following requirements:

Simply call the tokenizeAsync function with the code and language you want to highlight.

import {tokenizeAsync} from 'code-colors';

const code = `console.log('Hello, World!');`;
const language = 'javascript';

const tokens = await tokenizeAsync(code, language);
console.log(tokens);

It will automatically download popular Prism languages from the CDN.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4