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

codemirror-cel

v0.1.1

Published

CodeMirror 6 extension for CEL (Common Expression Language) with LSP-powered diagnostics, autocompletion, hover, and semantic highlighting via a WASM language server.

Readme

codemirror-cel

A CodeMirror 6 extension that adds full language support for CEL (Common Expression Language) — powered by a WASM language server running in a Web Worker.

Live demo

Features

  • Diagnostics — real-time error checking as you type
  • Autocompletion — variables, functions, methods, and field access
  • Hover — type information on hover
  • Semantic highlighting — full token-level highlighting that integrates with your CodeMirror theme

All of this runs entirely in the browser — no server required.

Quick start

npm install codemirror-cel
import { cel } from "codemirror-cel";
import { basicSetup } from "codemirror";
import { EditorState } from "@codemirror/state";
import { EditorView } from "@codemirror/view";

const worker = new Worker(
  new URL("codemirror-cel/worker", import.meta.url),
  { type: "module" },
);

const celExtensions = await cel({
  worker,
  variables: [
    { name: "user", type: { kind: "map", keyType: "string", valueType: "dyn" } },
    { name: "now", type: "timestamp" },
  ],
  functions: [
    {
      name: "isEmail",
      params: [{ name: "value", type: "string" }],
      returnType: "bool",
    },
  ],
});

new EditorView({
  parent: document.getElementById("editor")!,
  state: EditorState.create({
    doc: 'user.email.endsWith("@acme.com") && isEmail(user.email)',
    extensions: [basicSetup, ...celExtensions],
  }),
});

Configuration

The cel() function accepts a CelConfig object:

| Option | Type | Default | Description | |---|---|---|---| | worker | Worker | (required) | A Web Worker running the celsp WASM language server. | | variables | VariableDeclaration[] | [] | Variables available in the CEL environment. | | functions | FunctionDeclaration[] | [] | Custom function declarations for the type-checker. | | rootUri | string | "file:///" | LSP workspace root URI. | | documentUri | string | "file:///cel.cel" | URI for the document being edited. | | languageId | string | "cel" | Language ID sent to the LSP server. | | hoverShowErrors | boolean | false | Include check-error details in hover tooltips. |

Types

Variables use CEL's type system:

// Primitive types
{ name: "active", type: "bool" }
{ name: "count", type: "int" }
{ name: "score", type: "double" }
{ name: "name", type: "string" }
{ name: "now", type: "timestamp" }
{ name: "ttl", type: "duration" }

// List type
{ name: "tags", type: { kind: "list", elementType: "string" } }

// Map type
{ name: "headers", type: { kind: "map", keyType: "string", valueType: "string" } }

// Nested types
{ name: "matrix", type: { kind: "list", elementType: { kind: "list", elementType: "int" } } }

Functions declare parameter names, types, and a return type:

{
  name: "clamp",
  params: [
    { name: "value", type: "double" },
    { name: "min", type: "double" },
    { name: "max", type: "double" },
  ],
  returnType: "double",
}

How it works

The extension runs a fork of celsp by ponix-dev — a CEL language server written in Rust — compiled to WebAssembly inside a Web Worker. LSP messages are bridged between the worker and CodeMirror via postMessage.

Semantic highlighting is handled through a custom side-channel (since the upstream CodeMirror LSP plugin doesn't support semantic tokens) and integrates with whatever HighlightStyle you have active (e.g. oneDark).

License

Unlicense — public domain.