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

@nldoc/api-specification

v1.1.187

Published

Specification for NLdoc API

Readme

NLdoc API Specification

pipeline status coverage report Latest Release NPM Version

An OpenAPI 3.1.0 compatible specification for the NLdoc API. This TypeScript library provides a comprehensive API framework for document conversion services, health monitoring, and file management.

Overview

This specification defines a standardized REST API for NLdoc services including:

  • Document conversion operations
  • Server-Sent Events (SSE) for conversion progress tracking
  • File retrieval and management
  • Health check endpoints

The API follows RPC-style principles inspired by REST, using clear, action-driven endpoints and standard HTTP semantics to deliver streamlined operations.

Getting Started

Prerequisites

  • Node.js >= 22.0.0 < 23.0.0
  • npm >= 10.0.0 < 12.0.0

Installation

Install the package via npm:

npm install @nldoc/api-specification

Or using yarn:

yarn add @nldoc/api-specification

Basic Usage

import {
  specification,
  validExamples,
  invalidExamples
} from '@nldoc/api-specification';

// Access the OpenAPI specification
console.log(specification);

// Use valid examples for testing
console.log(validExamples);

// Use invalid examples for validation testing
console.log(invalidExamples);

Accessing the OpenAPI Specification

After building the project, the complete OpenAPI 3.1.0 specification is available at:

# Build the project first
npm run build

# The OpenAPI specification is now available at:
# - public/openapi.json (JSON format)
# - public/index.html (Interactive HTML documentation)

Development

Local Setup

  1. Clone the repository:

    git clone https://gitlab.com/logius/nldoc/spec/api.git
    cd api-specification
  2. Install dependencies:

    npm install
  3. Build the project:

    npm run build

Available Scripts

  • npm run test - Run the test suite with Vitest and generate coverage reports
  • npm run build - Build the OpenAPI specification, examples, and TypeScript files
  • npm run lint - Lint the codebase using ESLint
  • npm run format - Format code using Prettier
  • npm run format:check - Check code formatting
  • npm run fix - Auto-fix linting and formatting issues
  • npm run lint:openapi - Validate OpenAPI specification against ADR standards and generate reports
  • npm run lint:spectral - Validate against Dutch API Design Rules (ADR 2.1)
  • npm run lint:vacuum - Generate an HTML report for the OpenAPI specification

Building Components

The build process consists of several steps:

  1. OpenAPI Generation: npm run build:openapi - Generates the OpenAPI JSON specification
  2. Example Extraction: npm run build:examples - Extracts valid and invalid test examples
  3. TypeScript Compilation: Compiles TypeScript to JavaScript for distribution
  4. Documentation: npm run build:redocly - Generates HTML documentation using Redocly

API Endpoints

The specification defines the following main endpoints:

Core Operations

  • POST /conversion: Convert files to different formats
  • GET /conversion/{uuid}: Stream conversion events via Server-Sent Events (SSE)
  • GET /file/{key}: Retrieve converted files
  • HEAD /file/{key}: Check file metadata

Health Monitoring

  • GET /health: Get health status with detailed response
  • HEAD /health: Quick health check

Headers and Parameters

The API uses standard headers for request tracking and versioning:

  • X-Trace-Id: Distributed tracing identifier
  • X-Request-Id: Unique request identifier
  • API-Version: API version information
  • Content-Type: Content type for requests and responses

API Documentation

The generated OpenAPI specification can be viewed:

  1. Locally: After building, open public/index.html in your browser
  2. Online: View the latest release documentation

Testing

Run the test suite:

npm test

Contributing

We welcome contributions! Please ensure:

  1. All tests pass (npm test)
  2. Code is properly formatted (npm run format:check)
  3. Linting rules are followed (npm run lint)
  4. OpenAPI specification is valid (npm run lint:openapi)
  5. Compliance with Dutch API Design Rules (npm run lint:spectral)

License

This project is licensed under the European Union Public License 1.2 - see LICENSE for details.

Acknowledgements