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

@gnata-sqlite/codemirror

v0.2.4

Published

CodeMirror 6 language support for JSONata — syntax highlighting, linting, and autocomplete

Readme

@gnata-sqlite/codemirror

CodeMirror 6 language support for JSONata — syntax highlighting, error diagnostics, autocomplete, and hover documentation.

Install

npm install @gnata-sqlite/codemirror

Serve the WASM files from your app's public directory:

  • gnata-lsp.wasm
  • lsp-wasm_exec.js

If you're using @gnata-sqlite/react, the WASM files are already included — run npx @gnata-sqlite/react to copy them into place.

Quick Start

import { EditorView, basicSetup } from "codemirror"
import { initWasm, jsonataFull } from "@gnata-sqlite/codemirror"
import "@gnata-sqlite/codemirror/styles.css"

await initWasm("/gnata-lsp.wasm", "/lsp-wasm_exec.js")

new EditorView({
  doc: '$sum(Account.Order.Product.(Price * Quantity))',
  extensions: [basicSetup, jsonataFull()],
  parent: document.getElementById("editor")!,
})

That gives you syntax highlighting, diagnostics, autocomplete, and hover docs.

Data-Aware Completions

Pass a schema to get field suggestions when typing after .:

const schema = JSON.stringify({
  fields: {
    Account: {
      type: "object",
      fields: {
        Order: { type: "array", fields: {
          Product: { type: "array", fields: {
            Price: { type: "number" },
            Quantity: { type: "number" },
          }}
        }}
      }
    }
  }
})

jsonataFull({ schema })
// or pass a getter for dynamic schemas:
jsonataFull({ schema: () => currentSchema })

Type Account.Order. and it suggests Product with type info. The @gnata-sqlite/react package exports a buildSchema() helper that generates this from sample JSON data.

Individual Extensions

jsonataFull() bundles everything. For fine-grained control, use the individual extensions:

import {
  jsonata,           // syntax highlighting only (no WASM needed)
  jsonataLint,       // error diagnostics
  jsonataCompletion, // autocomplete
  jsonataHover,      // hover tooltips
  jsonataLanguage,   // underlying language definition
} from "@gnata-sqlite/codemirror"

extensions: [
  jsonata(),
  jsonataLint(),
  jsonataHover({ schema: () => mySchema }),
  jsonataLanguage.data.of({
    autocomplete: jsonataCompletion({ schema: () => mySchema }),
  }),
]

jsonata() works without WASM — use it for syntax highlighting only, no initWasm() needed.

Styles

Import the bundled stylesheet for Tokyo Night-themed tooltips, autocomplete, and lint styling:

import "@gnata-sqlite/codemirror/styles.css"

Includes dark mode (default) and light mode (when <html> lacks a .dark class). Override any class in your own CSS to customize.

API Reference

| Export | Description | |--------|-------------| | initWasm(wasmUrl, execUrl) | Load the WASM module. Call once at startup. Returns a promise. | | jsonataFull(config?) | All-in-one extension: highlighting + linting + autocomplete + hover. | | jsonata() | Syntax highlighting only. No WASM required. | | jsonataLint() | Error diagnostics extension. | | jsonataCompletion(config?) | Autocomplete source. Pass { schema } for field completions. | | jsonataHover(config?) | Hover tooltip extension. Pass { schema } for field type info. | | jsonataLanguage | Underlying Lezer language definition. | | jsonataHighlighting | Syntax highlighting style tags. |

Schema config accepts { schema: string | (() => string) }.

License

MIT