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 🙏

© 2025 – Pkg Stats / Ryan Hefner

stan-language-server

v0.3.1

Published

Language Server Protocol implementation for the Stan probabilistic programming language

Readme

stan-language-server

A language server for the Stan probabilistic programming language written in TypeScript and using Bun to build an executable binary.

Features

  • Auto-completion: Keywords, functions, distributions, data types, and constraints
  • Hover information: Documentation and type information
  • Diagnostics: Real-time syntax and semantic error detection
  • Code formatting: Using the official Stan compiler
  • Include file support: Full #include resolution and compilation

Editor-specific configuration

VSCode:

Install the extension from Marketplace or open-vsx.

Neovim

There are many ways to install language servers in neovim. Here is one (if you have a different or better way, consider contributing it!):

Download the latest language server executable from GitHub and put it somewhere in your PATH. Then in your nvim config folder add lua/lsp/init.lua with:

local servers = {
    stan_ls = "lsp.stan",
}

local function setup_server(name, config_module)
    local config = require(config_module)

    vim.api.nvim_create_autocmd("FileType", {
        pattern = config.filetypes,
        callback = function()
            if #vim.lsp.get_clients({ bufnr = 0, name = name }) > 0 then
                return
            end

            local root_dir = vim.fs.root(0, config.root_markers)
            print(string.format("Starting %s for buffer %d with root: %s", name, vim.api.nvim_get_current_buf(),
                root_dir or "none"))

            vim.lsp.start({
                name = name,
                cmd = config.cmd,
                root_dir = root_dir,
                initialization_options = config.settings or {},
                on_exit = function(code, signal)
                    print(string.format("%s exited with code %d, signal %d", name, code, signal))
                end,
            })
        end,
    })
end

for server_name, config_path in pairs(servers) do
    setup_server(server_name, config_path)
end

Then in lua/lsp/stan.lua add the following:

return {
    cmd = { "stan-language-server", "--stdio" },
    filetypes = { "stan" },
    root_markers = { ".git" },
    settings = {
        maxLineLength = 78,
        includePaths = {},
    },
}

Zed

Install the Stan extension.

Sublime Text 4

Using LSP for Sublime Text, download the latest release and add the following to the settings file:

{
  "clients": {
    "stan-lsp": {
      "enabled": true,
      "command": ["/YOUR/PATH/TO/stan-language-server", "--stdio"],
      "selector": "source.stan | source.stanfunctions",
      "initializationOptions": {},
      "settings": {
        "stan-language-server": { "includePaths": [], "maxLineLength": 78 }
      }
  }
}

Emacs (eglot)

Assuming you are using stan-ts-mode, download the latest release and add the following to your init.el:

; elgot is built in to emacs 29+, but a similar config would work for lsp-mode
(with-eval-after-load 'eglot
    (add-to-list 'eglot-server-programs
        '(stan-ts-mode . ("/YOUR/PATH/TO/stan-language-server" "--stdio"))))

For developers

Development uses bun

To install dependencies:

bun install

Building a binary executable:

bun build:binary

To run unit tests:

bun test

To run end-to-end tests:

pip install pytest pytest-lsp
bun build:binary && pytest tests/