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

bend2-lsp

v0.1.1

Published

Language server for Bend 2

Readme

Bend 2 language server

bend2-lsp provides formatting, live compiler diagnostics, Markdown hover, and import go-to-definition for Bend 2 over LSP stdio. Node.js 26.9 or newer is required.

npm install -g bend2-lsp
bend2-lsp --stdio

To build from source, run npm ci && npm test.

The server accepts the bend and bend2 language IDs. It uses full-document sync, publishes diagnostics on open and 250 ms after edits, and rechecks open documents that import a changed buffer. Open buffers override files on disk. Go-to-definition resolves relative import paths, aliases, and imported top-level declarations. Compiler analysis is limited to file: documents; untitled documents still receive formatting, lexical diagnostics, and syntax hover.

Analysis uses the bundled Bend compiler and Base library in a worker thread. Relative imports resolve from the document, then from open overlays. Hash package imports use BEND_LIB; missing packages may be downloaded from BEND_HUB, checked by the compiler, and cached in the normal package layout. Downloads time out after 10 seconds.

The formatter preserves line breaks, blank lines, comments, literal spelling, line endings, and final-newline state. It normalizes indentation and safe token spacing without wrapping code.

Editor setup

VS Code:

Install the Bend 2 extension (kbrianps.bend2, also on Open VSX), which bundles bend2-lsp and provides syntax highlighting, live diagnostics, hover, and formatting out of the box.

To point the extension at a custom or local server build, set bend.server.path in settings.json:

{
  "bend.server.path": "bend2-lsp"
}

Neovim with nvim-lspconfig:

vim.api.nvim_create_autocmd("FileType", {
  pattern = "bend",
  callback = function()
    vim.lsp.start({
      name = "bend2-lsp",
      cmd = { "bend2-lsp", "--stdio" },
      root_dir = vim.fs.root(0, { ".git" }),
    })
  end,
})

Helix (languages.toml):

[language-server.bend2-lsp]
command = "bend2-lsp"
args = ["--stdio"]

[[language]]
name = "bend"
scope = "source.bend"
file-types = ["bend"]
language-servers = ["bend2-lsp"]
auto-format = true

Emacs with Eglot:

(add-to-list 'eglot-server-programs
             '(bend-mode . ("bend2-lsp" "--stdio")))

Local-variable type hover is intentionally out of scope because it would require instrumentation in the trusted checker. Unknown names and inferred locals therefore return no hover.

Compiler source

vendor/bend2/bend.ts and vendor/bend2/base.bend are unmodified copies from don2e4/bend commit bacc663. They are bundled into the npm package so installation does not require a Bend checkout. The compiler and this language server are licensed under Apache 2.0; see LICENSE. Update both vendored files together from a pinned Bend commit, then run npm test and inspect npm pack --dry-run before releasing.