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

@octanejs/monaco-editor

v0.0.36

Published

Monaco Editor components and loader hooks for Octane, ported from @monaco-editor/react without a React runtime dependency.

Readme

@octanejs/monaco-editor

Octane bindings for Monaco Editor, ported from @monaco-editor/react 4.7.0 (commit eb120e66).

npm install @octanejs/monaco-editor monaco-editor octane
pnpm add @octanejs/monaco-editor monaco-editor octane
import Editor, { DiffEditor, useMonaco, loader } from '@octanejs/monaco-editor';

function App() @{
	<Editor
		height="400px"
		defaultLanguage="typescript"
		defaultValue="// hello"
		onChange={(value) => console.log(value)}
	/>
}

Compatibility

| Upstream | Octane | | --- | --- | | loading?: ReactNode | loading?: OctaneNode | | Internal _ref on MonacoContainer | Octane ref on the host div (internal only) | | React memo | Octane memo | | Library onChange | Same name (not DOM onInput) | | Blind model dispose on unmount | Ownership-aware dispose — only models created by the binding are disposed; shared or external models are left intact |

See UPSTREAM.md for the full export crosswalk and status.json for the binding scorecard.

Loader and workers

The package re-exports @monaco-editor/loader. Workers and CSS stay in the consuming app.

Pin the same monaco-editor minor your peer range resolves to (workspace catalog / oracle: 0.55.1).

Default (recommended): npm monaco-editor + Vite workers

monaco-editor 0.55.1 exports "./*": "./*", so worker imports use the full esm/vs/... paths (unlike 0.56+, which maps shorthand subpaths).

import * as monaco from 'monaco-editor';
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
import { loader } from '@octanejs/monaco-editor';
import 'monaco-editor/min/vs/editor/editor.main.css';

globalThis.MonacoEnvironment = {
	getWorker(_id, label) {
		switch (label) {
			case 'json':
				return new jsonWorker();
			case 'css':
			case 'scss':
			case 'less':
				return new cssWorker();
			case 'html':
			case 'handlebars':
			case 'razor':
				return new htmlWorker();
			case 'typescript':
			case 'javascript':
				return new tsWorker();
			default:
				return new editorWorker();
		}
	},
};

loader.config({ monaco });

Give the editor a non-zero height (default height/width are 100%, and automaticLayout is on).

Alternate: CDN AMD build

Apps that intentionally avoid bundling Monaco can keep the loader CDN paths:

import { loader } from '@octanejs/monaco-editor';

loader.config({
	paths: {
		vs: 'https://cdn.jsdelivr.net/npm/[email protected]/min/vs',
	},
});

SSR / Hydrate

Do not call loader.init() on the server. Editor / DiffEditor render a loading shell during SSR; after hydrateRoot, effects create the editor. Prefer client-only mount or Octane lazy when the page does not need the shell in HTML.

Multi-model

path / defaultPath create models via monaco.Uri.parse. View state is kept in a process-global WeakMap keyed by model identity when saveViewState is true (upstream 4.7.0 uses a path-string Map). Models the binding creates are tracked for ownership-aware disposal on unmount.

Example

Working consumer recipe: examples/monaco-playground.