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

flatbuffers-format-editors

v0.1.0

Published

Browser editor integrations for FlatBuffers schemas: CodeMirror 6 language extension, Monaco Monarch tokenizer, and a <flatbuffers-editor> Web Component. Delegates to the flatbuffers-format engine for formatting; bring your own renderer.

Readme

flatbuffers-format-editors

Browser editor integrations for FlatBuffers schemas — CodeMirror 6, Monaco editor, and a drop-in <flatbuffers-editor> Web Component.

npm version License: MIT

Three thin wrappers around the flatbuffers-format engine. Each lets you put a FlatBuffers schema editor on a web page, with syntax highlighting and one-shortcut formatting that produces byte-for-byte the same output as the CLI / VS Code / IntelliJ / pre-commit-hook integrations.

Pick whichever integration matches the editor you already use:

| If you're using… | Import this | |----------------------------------------|---------------------------------------------------| | CodeMirror 6 | flatbuffers-format-editors/codemirror | | Monaco editor | flatbuffers-format-editors/monaco | | Plain HTML / Markdown / framework HTML | flatbuffers-format-editors/web-component |

Install

npm install flatbuffers-format-editors flatbuffers-format

The editor packages (@codemirror/*, monaco-editor) are listed as optional peer dependencies — install whichever ones the integration you import actually needs.

# CodeMirror integration
npm install @codemirror/state @codemirror/view @codemirror/language

# Monaco integration
npm install monaco-editor

# Web Component: depends on CodeMirror under the hood, so install those.
npm install @codemirror/state @codemirror/view @codemirror/language

CodeMirror 6

import { EditorView, basicSetup } from "codemirror";
import { flatbuffers, formatKeymap } from "flatbuffers-format-editors/codemirror";

new EditorView({
  doc: "table T { x: int; }",
  parent: document.body,
  extensions: [basicSetup, flatbuffers(), formatKeymap()],
});

flatbuffers() returns a LanguageSupport (the standard CodeMirror 6 shape — slot it into extensions: alongside basicSetup). formatKeymap() binds Ctrl/Cmd+Shift+F to "format the document via the in-process engine." formatCommand is also exported if you prefer to wire your own keybinding.

Monaco

import * as monaco from "monaco-editor";
import { registerFlatBuffers } from "flatbuffers-format-editors/monaco";

registerFlatBuffers(monaco);

monaco.editor.create(document.getElementById("editor")!, {
  value: "table T { x: int; }",
  language: "flatbuffers",
  formatOnSave: true,
});

registerFlatBuffers(monaco) does three things in one call:

  1. monaco.languages.register({ id: "flatbuffers", extensions: [".fbs"], … })
  2. setMonarchTokensProvider("flatbuffers", …) — keywords / builtin types / constants / numbers / strings / comments.
  3. registerDocumentFormattingEditProvider("flatbuffers", …)Format Document (Shift+Alt+F by default) runs the engine.

We don't bundle monaco-editor; you pass your own Monaco namespace. Works against any Monaco ≥ 0.40 that exposes the standard public API.

Web Component

For static HTML pages, Markdown→HTML pipelines, Astro, or any framework that accepts custom elements:

<flatbuffers-editor>
  table Monster {
    hp: short = 100;
    name: string;
  }
</flatbuffers-editor>

<script type="module">
  import "flatbuffers-format-editors/web-component";
</script>

Attributes:

| Attribute | Default | What it does | |------------|---------|--------------| | value | inline text content | Initial schema text. Live-bound. | | readonly | (off) | Disables editing when present. | | theme | light | Set theme="dark" for a dark-friendly editor surface. |

JS API:

const el = document.querySelector("flatbuffers-editor");
el.value;                    // getter — current schema text
el.value = "table T {}";     // setter — replaces content
el.format();                 // runs flatbuffers-format
el.addEventListener("change", e => {
  console.log("new value:", e.detail.value);
});

Internally backed by CodeMirror 6 (so the @codemirror/* packages need to be available to your bundler). Custom element name: <flatbuffers-editor>. If you need a different tag (collision, multiple variants), import the FlatBuffersEditorElement class directly and call customElements.define("my-editor", class extends FlatBuffersEditorElement {}).

How releases happen

Same release-please flow as the rest of the monorepo. Don't bump version in package.json by hand — Conventional Commits drive it. See CONTRIBUTING.md.

License

MIT. See LICENSE.