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

stylus-language-server

v0.12.0

Published

Language server for Stylus powered by the official Stylus compiler

Readme

Stylus Language Server

A Language Server Protocol implementation for Stylus, backed by the official Stylus compiler.

The server accepts --stdio and provides:

  • Diagnostics — the first error reported by the official compiler (syntax, evaluation, and @import/@require resolution), debounced while typing and refreshed on save. Errors inside imported files are published on that file's URI.
  • Stylelint — optional style diagnostics via bundled Stylelint 16 and postcss-styl (with the official stylelint-stylus plugin available to configurations). Disabled unless a project stylelint configuration is discoverable or explicitly enabled through initialization options.
  • Completions — CSS properties and values, Stylus built-in functions, at-rules, pseudo-classes and pseudo-elements, HTML tags, and the variables, mixins, and functions defined in the current file.
  • Hover — variable declarations, mixin/function signatures, Stylus built-in documentation, and CSS property documentation with MDN links.
  • Color swatches — hex, rgb()/rgba(), hsl()/hsla(), named colors, usages of color-valued variables, and compiler-evaluated expressions such as lighten(#3498db, 10%) or rgba($primary, 0.5). The color picker offers hex/RGB/HSL replacements for literal color text only.
  • Signature help — user mixins with declared parameters and Stylus built-ins with runtime-accurate signatures, tracking the active parameter across nested calls.
  • Navigation — go-to-definition, find-references, and rename for variables, mixins, and functions. Resolution is scope-aware: it understands indentation-based visibility, shadowing, parameters, and loop variables, and rename preserves each occurrence's $ style.
  • Cross-file symbols — root-level variables and mixins from @imported files appear in completions, hover, and go-to-definition, which jumps into the dependency. Resolution follows the compiler's lookup rules: relative paths, index.styl, node_modules packages (including package.json main and scoped packages), and glob imports, with cycle protection. The index tracks imported files' modification times.
  • Workspace references — find-references and rename span every .styl file that can transitively import the declaration, using a reverse import graph over the workspace, while honoring each file's own scoping rules.
  • Document symbols — file-local variables and mixins/functions.
  • Formatting — three engines: a from-scratch style-preserving indent engine (default) verified by structural, compiler, and idempotency checks; stylus-supremacy behind safety guards; and a minimal whitespace engine. Range formatting is supported for whole documents and selections.

CSS data comes from @vscode/web-custom-data; Stylus built-in signatures are read from the installed compiler's own sources. File-local symbols use a resilient line-based index that keeps working while the document is broken mid-edit. The server does not provide navigation, formatting, or lint rules.

npx stylus-language-server --stdio

This package is developed as part of stylus-zed.

Security Notes

npm audit currently reports 4 high and 3 moderate advisories, all inside stylint — an unmaintained transitive dependency of stylus-supremacy (brace-expansion, minimatch, glob, yargs/yargs-parser). Those advisories affect stylint's command-line file globbing and CLI argument parsing, which this server never executes: formatting runs in-process through stylus-supremacy.format() on document text only, and no glob patterns or CLI input reach the vulnerable code. The fixable advisory in the chain (mout) is already overridden to a patched version. If stylus-supremacy drops or replaces its stylint dependency in a future release, the remaining advisories disappear.

Acknowledgements

License

MIT