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

@open-docs/model

v0.1.0

Published

Universal documentation model for OpenDocs - language-agnostic API documentation representation

Readme

@open-docs/model

Universal documentation model for OpenDocs - language-agnostic API documentation representation

Overview

@open-docs/model provides TypeScript types and utilities for working with OpenDocs documentation. It implements the OpenDocs specification's five core models that enable language-agnostic documentation extraction and processing.

Core Models

DocSet

The root object representing opendocs.json - the entry point for your Documentation Set.

import { DocSet, DocSetUtils } from '@open-docs/model';

const docSet: DocSet = DocSetUtils.create({
  id: 'my-docs',
  name: 'My Documentation',
  description: 'API documentation for my project',
  generator: {
    name: 'opendocs-extractor-typescript',
    version: '0.1.0',
  },
});

Project

Represents an individual project (package, library, app) within a Documentation Set.

import { Project, SupportedLanguages } from '@open-docs/model';

const project: Project = {
  id: 'my-package',
  name: 'My Package',
  language: SupportedLanguages.TYPESCRIPT,
  version: '1.0.0',
  items: [],
};

DocItem

The universal element representing any documentable code (classes, functions, methods, etc.).

import { DocItem, ItemKind } from '@open-docs/model';

const classItem: DocItem = {
  id: 'MyClass',
  name: 'MyClass',
  kind: ItemKind.CLASS,
  visibility: 'public',
  items: [], // child items (methods, properties)
};

DocBlock

Structured documentation content extracted from code comments.

import { DocBlock } from '@open-docs/model';

const docBlock: DocBlock = {
  description: 'Main description of the element',
  remarks: 'Extended documentation',
  tags: [
    {
      tag: 'param',
      name: 'value',
      type: 'string',
      content: 'The value to process',
    },
    {
      tag: 'returns',
      type: 'boolean',
      content: 'True if successful',
    },
  ],
};

DocTag

Individual documentation tags (@param, @returns, @deprecated, etc.).

import { DocTag, CommonTags } from '@open-docs/model';

const paramTag: DocTag = {
  tag: CommonTags.PARAM,
  name: 'value',
  type: 'string',
  content: 'The value to process',
};

Design Principles

OpenDocs follows five fundamental design principles:

  1. Universal Abstraction: Every element maps to a standardized DocItem
  2. Language-Specific Flexibility: The kind field preserves language-specific typing
  3. Hierarchical Structure: Supports monorepos with nested projects and items
  4. Documentation Standardization: Unified DocBlock structure across all formats
  5. Tag Flexibility: Support for both simple and complex tags with custom extensions

Utilities

Each model comes with utility functions for common operations:

import {
  DocSetUtils,
  ProjectUtils,
  DocItemUtils,
  DocBlockUtils,
  ContainerRefUtils,
} from '@open-docs/model';

// Find a project
const project = DocSetUtils.findProjectById(docSet, 'my-package');

// Find an item in a project
const item = ProjectUtils.findItemById(project, 'MyClass');

// Check if item is a container
const isContainer = DocItemUtils.isContainer(item);

// Find tags
const paramTags = DocBlockUtils.getParamTags(docBlock);

Usage with Extractors

This library is designed to be used by OpenDocs extractors for different languages:

  • @opendocs/extractor-typescript - TypeScript/JavaScript extractor
  • @opendocs/extractor-python - Python extractor
  • @opendocs/extractor-go - Go extractor

Each extractor uses this model to generate OpenDocs-compliant JSON output.

License

MIT