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

@mosetta/ide-plugin-code

v0.0.14

Published

The one way code is shown: languages, highlighting, line diffs and a read-only code view.

Readme

Code display

@mosetta/ide-plugin-code · The one way code is shown: languages, highlighting, line diffs and a read-only code view.

What it does

Code appears in many places besides the editor: the preview in search everywhere, the diff over the editor, the merge screen, a hunk popup, the debugger's view of a file outside the project. All of them show code through this plugin, so a file looks the same wherever it turns up — one set of languages, one highlighting, one font, one diff.

  • Languages by extension: TypeScript and JavaScript (with JSX), JSON, CSS, HTML and Markdown.
  • Highlighting from the theme's palette, so switching the theme recolours every view of code at once.
  • A line diff that everyone uses — the git strips, the diff screen and merge all compare lines the same way.
  • A read-only code view, scrolled to a line.

The editor's settings (fontFamily, fontSize, tabSize and the rest) are declared here and shown in the settings window under the Editor.

Screenshots and demos

The same code in the search preview and in the diff

Try it in the browser

Using it from another plugin

Take the instance and use its fields; there is nothing to register.

import CodePlugin, { EDITOR_DEFAULTS } from '@mosetta/ide-plugin-code';

const code = this.ide.getPlugin(CodePlugin);

// Show a file read-only, scrolled to a line (zero-based) and in the editor's font.
const settings = this.ide.settingsOf('editor', EDITOR_DEFAULTS).value;
const preview = <code.View path="src/flock.ts" text={text} line={24} settings={settings} />;

// Compare two texts line by line.
const hunks = code.diff.hunks(before, after);

| Field | What it is | |---|---| | View | A Preact component that shows code with the IDE's look and languages. | | languages | of(path): the CodeMirror language for a file, by its extension. | | diff | The line diff: hunks(before, after), and reverted(text, hunk) to put one hunk back. | | painter | Paints a line into highlighted chunks — for code drawn outside CodeMirror. | | input | The shared input mechanics: how keys behave in code, in every view that edits. | | look | The CodeMirror theme and highlight style, built from the theme's palette. |

The module also exports the editor's settings (EDITOR_DEFAULTS, EDITOR_SCHEMA, EditorSettings) so that every view of code reads the same font and tab size.