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

cm6-lezer-lit-html

v0.8.11

Published

CodeMirror 6 Lezer JavaScript grammar fork with direct Lit html/svg/css tagged-template nodes

Readme

0.8.10

  • Hardened Lit CSS parsing for quoted CSS strings that contain braces or escaped backticks.
  • Allowed selector-position interpolations such as .x-${suffix} without making a top-level ${sharedStyles} ambiguous.
  • Added regression coverage for attribute selectors, pseudo selectors, @keyframes, @font-face, @property, and preserving HTML quoted-attribute interpolation.

cm6-lezer-lit-html

A CodeMirror 6 / Lezer JavaScript grammar fork that parses Lit html, svg, and css tagged templates directly into ordinary syntax-tree nodes.

This package is intentionally shaped for CST matching. Unlike a mixed parser, Lit and CSS template structure is visible during a normal tree walk—no mounted-tree traversal or collector pass is required.

Install

npm install cm6-lezer-lit-html

Use

import {litJavaScript} from "cm6-lezer-lit-html";

const tree = litJavaScript.parse(`
  import {html, css} from "lit";
  const view = html` + "`" + `<x-card .item=${"${item}"} @save=${"${onSave}"}></x-card>` + "`" + `;
  const styles = css` + "`" + `:host { display: block; }` + "`" + `;
`);

The exported parser is named litJavaScript.

Matcher-facing Lit nodes

Examples of nodes exposed directly in the JavaScript tree include:

  • LitHtmlTaggedTemplateExpression
  • LitSvgTaggedTemplateExpression
  • LitCssTaggedTemplateExpression
  • LitTemplate
  • ComponentElement
  • Element
  • VoidElement
  • DynamicElement
  • OpenTag / CloseTag / SelfClosingTag
  • EventListener
  • PropertyInput
  • BooleanInput
  • SpreadInput
  • AttributeInput
  • DynamicValue
  • Interpolation
  • StyleSheet
  • CssRule
  • CssSelector
  • CssBlock
  • CssBlockContent
  • CssAtRule
  • CssAtPrelude
  • CssDeclaration
  • CssDeclarationValue
  • CssPropertyName
  • CssClassSelector
  • CssHash

Scope

This is a matcher-oriented grammar fork, not a full browser-grade HTML/CSS validator. It is designed to preserve useful Lit/CSS CST structure inside a single JavaScript parse tree.

Version 0.8.8 note

0.8.8 keeps the nested-template fix from 0.8.5 and adds structured CSS blocks. CSS tagged templates now expose matcher-facing nodes such as CssRule, CssSelector, CssBlock, CssBlockContent, CssAtRule, CssAtPrelude, CssDeclaration, and CssDeclarationValue.

The CSS parser is still forgiving and matcher-oriented rather than a full CSS spec validator. It is designed to keep the outer JavaScript/Lit parse stable while distinguishing selectors, blocks, at-rules, declarations, values, comments, and interpolations.

0.8.9

  • Fix CSS vendor-prefixed property names such as -webkit-user-select: and -ms-user-select:.
  • Prevent complex css template bodies with vendor-prefixed declarations and !important values from leaking out of LitCssTaggedTemplateExpression into ordinary JavaScript/error nodes.

0.8.11

CSS hardening pass for edge cases discovered after 0.8.10. Adds coverage for at-rule string preludes such as @charset/@import, interpolated CSS property names like ${prop}: value, nested/braced custom-property values, and additional modern nesting/container/scope selector cases. Keeps complex CSS inside LitCssTaggedTemplateExpression without leaking into JavaScript recovery.