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

@stepcode/codemirror

v2.0.0

Published

CodeMirror 6 language support and debug extensions for StepCode

Readme

@stepcode/codemirror

CodeMirror 6 language support for StepCode, built on the same parser and checker the runtime uses, plus the editor-side debugging extensions. No worker, no interpreter: a host wires those.

import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language'
import { lintGutter } from '@codemirror/lint'
import { EditorState } from '@codemirror/state'
import { EditorView, lineNumbers } from '@codemirror/view'
import { breakpointLines, breakpointsChanged, debug, setCurrentLine, stepcode } from '@stepcode/codemirror'
import { profiles } from '@stepcode/profiles'

const view = new EditorView({
  state: EditorState.create({
    doc: 'Proceso hola\n  Escribir "hola";\nFinProceso',
    extensions: [
      stepcode({ profile: profiles.es }),
      debug(),
      // the host's choices:
      syntaxHighlighting(defaultHighlightStyle),
      lintGutter(),
      lineNumbers(),
      EditorView.updateListener.of((update) => {
        if (breakpointsChanged(update)) console.log(breakpointLines(update.state))
      }),
    ],
  }),
  parent: document.body,
})

// from a paused run:
view.dispatch({ effects: setCurrentLine.of(2) })

What stepcode() bundles

One LanguageSupport per profile: the syntax tree (compiled by stepcode's compile inside a Lezer parser, so highlighting, diagnostics and completion never disagree), lint, folding, indentation, block matching (Si ↔ FinSi), completion with block snippets, signature help, hover, F12 go to definition, and ← for a typed <-. Switch profiles by wrapping it in a Compartment.

Every piece is also exported alone: stepcodeLanguage, stepcodeLint, stepcodeCompletion, stepcodeSignatureHelp, stepcodeHover, stepcodeBlockMatching, arrowInput, stepcodeKeymap. compileResultAt(state) hands back the CompileResult the tree was built from, treeDataAt(state) adds the offset maps the features use, and stepcodeDiagnostics(state, options) is the lint mapping without the linter, for a host's own Problems panel.

Not included on purpose: a highlight style, the lint gutter, line numbers, history, the default keymap.

Debugging

debug() (or breakpoints() and currentLine() separately) is pure editor state:

  • a breakpoint gutter — click to toggle; breakpointLines(state) reads the lines, setBreakpoints.of(lines) / toggleBreakpoint.of({ line }) change them, breakpointsChanged(update) tells an update listener when to resend them;
  • a current-line marker — setCurrentLine.of(line | null) highlights the line, marks the gutter and scrolls it into view; currentLineOf(state) reads it back.

Markers follow their lines through edits and vanish when the line is deleted.

Styling

The bundle ships a base theme, so the CSS class hooks are there to override: the breakpoint gutter (.cm-stepcode-breakpoints, .cm-stepcode-breakpoint), the current line (.cm-stepcode-current-line, .cm-stepcode-current-line-marker), the hover and signature tooltips (.cm-stepcode-hover, .cm-stepcode-signature, .cm-stepcode-signature-active), and the matching keyword pair (.cm-matchingBracket, .cm-nonmatchingBracket).

Strings

Diagnostics render through stepcode's catalogs; the few strings this package adds (symbol kinds, "declared on line", snippet placeholders) come from its own table, which covers es and en and falls back to en. stepcode({ profile, locale }) defaults locale to the profile's.