npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apollohg/react-native-rich-text-editor-code-highlighting

v2.2.2

Published

Optional native syntax highlighting for @apollohg/react-native-rich-text-editor

Readme

Native code highlighting

Optional syntax highlighting for @apollohg/react-native-rich-text-editor. Requires Expo native modules and a native app rebuild after installation.

npm install @apollohg/react-native-rich-text-editor-code-highlighting
import { RichTextEditor } from '@apollohg/react-native-rich-text-editor';
import { createCodeHighlightingAddon } from '@apollohg/react-native-rich-text-editor-code-highlighting';

const highlighting = createCodeHighlightingAddon({ theme: 'base16-ocean.dark' });

<RichTextEditor documentHandle={documentHandle} addons={[highlighting]} />;

RichTextViewer accepts the same addon. Set the code block's language attribute to select its grammar. Supported language values are javascript/js, typescript/ts, tsx, jsx, swift, kotlin/kt, rust/rs, python/py, json, html, css, and bash/shell/sh. JSX uses the TypeScript React grammar. Missing, plain, and unsupported language values render ordinary code without guessing.

codeHighlightingThemes lists the seven supported theme names. The selected theme contributes token foregrounds and bold/italic/underline traits. The editor's codeBlock style controls panel geometry and background.

The package registers its native provider synchronously when imported. Factories only create immutable configuration. Omit the descriptor to disable work for a view; uninstall and rebuild to remove the engine and grammar assets from the app. The base editor does not install this package automatically.

The engine uses syntect 5.3.0 with its pure Rust regex backend and the two-face 0.5.1 compatible grammar pack. Prebuilt libraries are included for iOS device/simulator and Android arm64-v8a, armeabi-v7a, x86, and x86_64. Consumer installation does not invoke Cargo.

Blocks over 64 KiB, lines over 4 KiB, or blocks over 1,000 lines fall back to ordinary styling. A worker-local cache retains at most 64 blocks and 1 MiB of accounted source/range data. Regex backtracking has the upstream finite step limit; this is not a wall-clock timeout. No syntax state or color marks are written to the document.

The core and all extensions share the same release version. Installing only the core does not install this extension or its native engine and grammar assets.

Maintainers build from this repository with Rust 1.95.0, the seven mobile Rust targets, Xcode, Android NDK and cargo-ndk installed:

npm run build
npm run test:rust
npm run build:native
npm pack

Licenses and attribution

This package's own code is Apache-2.0. Syntect is MIT-licensed; its bundled grammars, themes, Rust dependencies, and native dependencies retain their own licenses. Full texts, copyright notices, and corresponding-source links are included in THIRD_PARTY_NOTICES.md and RUST-STANDARD-LIBRARY-NOTICES.html.

Include these notices alongside the core editor's notices in your distributed app's open-source acknowledgements or accompanying materials. Keep the MPL corresponding-source links and notices for the framework/native dependency versions your app actually resolves. Refresh these files when upgrading dependencies, syntax/theme assets, or the Rust toolchain.

Releases

Bump versions from the repository root with npm version; its version hook synchronizes every extension and the example lockfile. The Publish / Dry Run workflow builds and validates the core and highlighting artifacts, then publishes them together when a GitHub release is published. Pushes and pull requests affecting extensions run the same validation without publishing. Unchanged native sources reuse their own build cache; JavaScript and tarballs are always rebuilt. A retry skips package versions already published after a partial release.