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

@kunstmusik/codemirror-lang-csound

v1.0.2

Published

CodeMirror 6 language support for Csound (CSD, ORC, SCO)

Downloads

397

Readme

@kunstmusik/codemirror-lang-csound

CodeMirror 6 language support for Csound, covering CSD, ORC, and SCO files.

Features

  • One Lezer-based language package with modes for full .csd, orchestra .orc, and score .sco documents.
  • Syntax highlighting, indentation, folding, and comment support for Csound editing.
  • Opcode autocomplete backed by generated Csound opcode metadata.
  • Semantic highlighting for built-in opcodes, UDOs, p-fields, named instruments, and score fragments.
  • Hover info for built-in opcodes and document-local UDOs.

Install

npm install @kunstmusik/codemirror-lang-csound

Changelog

1.0.2

  • Fix reading pfields to tokens with lower-case p.

1.0.1

  • Fixed the package exports condition ordering so newer Vite and Rolldown-based builds do not fail on the published package metadata.
  • No runtime API changes. This is a packaging and compatibility release on top of 1.0.0.

1.0.0

  • Initial public release of the Csound CodeMirror 6 language package.
  • Shipped CSD, ORC, and SCO modes with autocomplete, semantic highlighting, hover info, and the rich opcode metadata entrypoint.

Quick Start

import { EditorState } from "@codemirror/state"
import { EditorView } from "@codemirror/view"
import { basicSetup } from "codemirror"
import { csound } from "@kunstmusik/codemirror-lang-csound"

const doc = `<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
instr 1
  a1 oscil 0.2, 440
  out a1
endin
</CsInstruments>
<CsScore>
i1 0 1
e
</CsScore>
</CsoundSynthesizer>`

const state = EditorState.create({
  doc,
  extensions: [
    basicSetup,
    csound({ mode: "csd" }),
  ],
})

new EditorView({
  state,
  parent: document.querySelector("#editor")!,
})

csound() defaults to mode: "csd". It also enables semantic highlighting and hover support by default.

Modes

import { csound } from "@kunstmusik/codemirror-lang-csound"

csound({ mode: "csd" })
csound({ mode: "orc" })
csound({ mode: "sco" })

If you need the bare languages instead of the bundled LanguageSupport, the package also exports csoundCsdLanguage, csoundOrcLanguage, and csoundScoLanguage.

Optional Configuration

csound({
  mode: "orc",
  semanticHighlighting: false,
  hover: false,
})

Rich Metadata Entry Point

The package exposes a separate rich metadata bundle at @kunstmusik/codemirror-lang-csound/rich for consumers that want direct access to the manual-derived opcode catalog.

import { csoundRichOpcodeCatalog } from "@kunstmusik/codemirror-lang-csound/rich"

Hover support lazy-loads that richer catalog automatically when it needs manual metadata.

V1 Scope

The 1.0.x baseline is aimed at editor support first. Some ambiguous opcode/assignment lines still fall back to generic-line parsing, and some alternate score-bin dialects are intentionally left as post-v1 follow-up work.