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

@speclynx/apidom-ls

v2.2.1

Published

SpecLynx ApiDOM Language Service.

Readme


Overview

SpecLynx ApiDOM Language Service (@speclynx/apidom-ls) is a language service library that provides intelligent editing features for API description languages. It implements programmatic language features following the Language Server Protocol (LSP) specification, making it easy to integrate into any LSP-compatible editor or IDE through a server wrapper.

Note: This is a language service, not a language server. A language service is a library that implements language features, while a language server is a separate process that communicates via LSP. This library can be wrapped by an LSP server to expose its features to editors.

Supported Languages

| Language | Versions | Formats | |----------|-----------------------------------|---------| | OpenAPI | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.1.1, 3.1.2 | JSON, YAML | | AsyncAPI | 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | JSON, YAML | | Arazzo | 1.0.0, 1.0.1 | JSON, YAML | | JSON Schema | Draft 4/5, 6, 7, 2019-09, 2020-12 | JSON, YAML |

Features

The language service provides the following LSP-compatible features:

| Feature | Method | Description | |---------|--------|-------------| | Validation | doValidation() | Syntax and semantic validation with diagnostics | | Completion | doCompletion() | Context-aware auto-completion suggestions | | Hover | doHover() | Documentation and type information on hover | | Go to Definition | doProvideDefinition() | Navigate to $ref target definitions | | Find References | doProvideReferences() | Find all references to a symbol | | Document Symbols | doFindDocumentSymbols() | Outline view and breadcrumbs | | Semantic Tokens | computeSemanticTokens() | Enhanced syntax highlighting | | Code Actions | doCodeActions() | Quick fixes and refactoring | | Document Links | doLinks() | Clickable links in documents | | Formatting | doFormatting() | Document formatting | | Dereferencing | doDeref() | Resolve all $ref references | | Format Conversion | doConversion() | Convert between JSON and YAML | | Color Support | findDocumentColors() | Color picker for color values |

Installation

npm install @speclynx/apidom-ls

Quick Start

Basic Setup

import { getLanguageService } from '@speclynx/apidom-ls';
import { TextDocument } from 'vscode-languageserver-textdocument';

// Create the language service
const languageService = getLanguageService({});

// Create a document from your API specification
const spec = `
openapi: "3.1.0"
info:
  title: My API
  version: 1.0.0
paths: {}
`;

const document = TextDocument.create(
  'file:///api.yaml',
  'yaml',
  0,
  spec
);

Validation

const diagnostics = await languageService.doValidation(document);

for (const diagnostic of diagnostics) {
  console.log(`[${diagnostic.severity}] Line ${diagnostic.range.start.line}: ${diagnostic.message}`);
}

Auto-Completion

import { Position } from 'vscode-languageserver-types';

const position = Position.create(4, 2); // line 4, character 2
const completions = await languageService.doCompletion(document, {
  textDocument: { uri: document.uri },
  position
});

console.log('Suggestions:', completions?.items.map(item => item.label));

Hover Information

const hover = await languageService.doHover(document, Position.create(1, 5));

if (hover) {
  console.log('Hover content:', hover.contents);
}

Go to Definition

const definition = await languageService.doProvideDefinition(document, {
  textDocument: { uri: document.uri },
  position: Position.create(10, 15) // position on a $ref value
});

if (definition) {
  console.log('Definition location:', definition.uri, definition.range);
}

Cleanup

// Always terminate when done to free resources
languageService.terminate();

Advanced Configuration

The language service can be configured with custom providers and settings:

import { getLanguageService, LogLevel } from '@speclynx/apidom-ls';

const languageService = getLanguageService({
  // Logging configuration
  logLevel: LogLevel.WARN,
  performanceLogs: false,

  // Custom validation providers
  validatorProviders: [/* custom validators */],

  // Custom completion providers
  completionProviders: [/* custom completions */],

  // Custom hover providers
  hoverProviders: [/* custom hovers */],

  // Enable clickable links for URLs in hover
  hoverFollowLinkEntry: true,
});

Architecture

        ┌─────────────────────────────────────┐
        │          Your Application           │
        │      (IDE, Editor, CLI, etc.)       │
        └─────────────────┬───────────────────┘
                          │
                          ▼
        ┌─────────────────────────────────────┐
        │         LSP Server Wrapper          │
        │      (implements LSP protocol)      │
        └─────────────────┬───────────────────┘
                          │
                          ▼
  ╔═══════════════════════════════════════════════╗
  ║                                               ║
  ║       SpecLynx ApiDOM Language Service        ║
  ║            (this language service)            ║
  ║                                               ║
  ╚═══════════════════════╤═══════════════════════╝
                          │
                          ▼
        ┌─────────────────────────────────────┐
        │           SpecLynx ApiDOM           │
        │   parsing ∙ datamodel ∙ traversal   │
        └─────────────────────────────────────┘

Support & Documentation

For full documentation and enterprise support please contact: [email protected]

License

ApiDOM Language Service is licensed under Apache 2.0 license. ApiDOM Language Service comes with an explicit NOTICE file inside npm distribution package containing additional legal notices and information.

This project uses REUSE specification that defines a standardized method for declaring copyright and licensing for software projects.