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

@hydranium/data-server

v1.0.0-next.95

Published

Typed-RPC protocol head for the hydranium framework. Peer of @hydranium/core/lsp and @hydranium/glsp-server; built on @hydranium/core.

Readme

@hydranium/data-server

The typed JSON-RPC data head of hydranium: it exposes the live Langium AST to non-LSP clients — form editors, tree views, code generators — as an adopter-defined transfer model over a vscode-jsonrpc MessageConnection. Installed by the server process that already composes @hydranium/core; a client needs only @hydranium/protocol.

What it gives you

  • One class, DataServer. new DataServer(connection, services, options) self-wires: a single createRpcProxy call registers the inbound DataServerProtocol handlers and builds the outbound DataClientProtocol proxy on the same wire. It contributes no shared-tier DI bindings — it reads exclusively from ServerSharedServices, so there is no shared module to compose.
  • A document lifecycle over the shared workspace: openModelDocument, getModelDocument, updateModelDocument, saveModelDocument, closeModelDocument, watchModelDocument / unwatchModelDocument, and waitForReady for clients that must not race workspace initialisation.
  • Push notifications instead of polling: onDocumentUpdated when a subscribed document reaches the configured build phase (DataServerOptions.subscriptionPhase, DocumentState.Validated by default), onDocumentSaved on a separate channel, onDocumentDeleted on a third (a deleted document has no built state to carry, and the build-phase path never runs for one), onDocumentsBuilt once per build for the documents nobody watches — chiefly those rebuilt as a cascade, which no filesystem watcher can see because their own files did not change — and onProjectsChanged from the project registry.
  • Projects as first-class: getProjects and getProjectForUri, answered from the framework's ProjectManager.
  • An opt-in reference/naming slicefindReferenceCandidates, resolveReference, findNextName — implemented here but deliberately outside the DataServerProtocol composition, so a pure data consumer does not pay for it. Compose ReferenceServerProtocol onto the connection explicitly.
  • A diagnostics seam, DataServerDiagnosticsProvider, with the Node implementation nodeDataServerDiagnostics() behind ./node so the portable entry keeps bundling for a browser.

The projection itself is not this package's: it delegates to TransferEncoder and ModelService from @hydranium/core, so there is no second in-memory model to keep in sync.

Install

npm install @hydranium/data-server

This package bundles no runtime dependencies. Its peers must be present: @hydranium/core, @hydranium/protocol, @hydranium/langium, vscode-jsonrpc and vscode-languageserver-textdocument. You must already have a composed hydranium shared services tree and a MessageConnection — the socket and stdio launchers live in @hydranium/core/node, not here.

Exports

| subpath | holds | platform | | ----------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------- | | . | DataServer and its option types, plus the DataServerDiagnosticsProvider seam — the whole production surface. | browser-neutral | | ./node | nodeDataServerDiagnostics(), the runtime-backed half of the diagnostics seam. | Node-only | | ./testing | makeDataServerHarness — a real server driven in-process over a duplex connection pair. | Node-only (vscode-jsonrpc/node) |

. is gated as browser-neutral in CI (scripts/check-neutral-bundles.mjs). It stays that way through a browser field in package.json that swaps the diagnostics default for a browser twin, so a bundler never follows the @hydranium/core/node import a Node host resolves — see what "gated neutral" does and does not promise. Each subpath also has a ./lib/… twin for consumers on moduleResolution: "Node".

Getting oriented

Construct the head after the shared services tree exists and keep the returned instance for dispose; it registers its handlers on the connection you pass and subscribes to the document builder, the text-document store and the project manager for its push notifications. The typed contract a client codes against — DataServerProtocol, DataClientProtocol, the drift-proof method-name lists and the port constants — lives in @hydranium/protocol/data, and the generic createRpcProxy / bindRpcMethods machinery in @hydranium/protocol. The four distinct meanings of "document" this head sits between are worth reading first: docs/concepts/document-layers.md. See also docs/concepts/architecture.md and docs/concepts/head-module-maps.md.

Status

Alpha — pre-v0, not yet published. The API is not stable and may change without a deprecation cycle. See the repository README for the current status and known limitations.

License

MIT — see this package's LICENSE. Third-party notices for the repository are recorded in NOTICE.md.