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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@orderly.network/typedoc-json-parser

v9.0.3

Published

A package to parse TypeDoc JSON output

Downloads

85

Readme

TypeDoc JSON Parser

A package to parse TypeDoc JSON output.

GitHub npm

Support Server


Description

When creating a library in TypeScript, you will often need to create documentation. Very commonly you'll find yourself using TypeDoc to generate documentation. However, TypeDoc's JSON output is not very useful for parsing. This package makes this entire process of utilizing the JSON output of TypeDoc a lot easier.

Installation

You can use the following command to install this package, or replace npm install -D with your package manager of choice.

npm install -D typedoc-json-parser typedoc

Prerequisites

Before using this package's CLI you'll need to have TypeDoc setup correctly.

Here is an example typedoc.json taken from our package's repository.

{
  "$schema": "https://typedoc.org/schema.json",
  "entryPoints": ["src/index.ts"],
  "json": "docs/api.json",
  "tsconfig": "src/tsconfig.json"
}

CLI Usage

You can provider all options through CLI flags.

Usage: typedoc-json-parser [options]

Options:
  --json [path]     Path to the TypeDoc JSON output file to parse
  --migrate [path]  Path to the directory containing TypeDoc JSON Parser output files to migrate
  -v, --verbose     Print verbose information (default: false)
  -h, --help        display help for command

You can also set these options through a configuration file. This file should be located at your current working directory. It should be named .typedoc-json-parserrc, optionally suffixed with .json, .yml, or .yaml.

When using .typedoc-json-parserrc or .typedoc-json-parserrc.json as your config file you can also use the JSON schema to get schema validation. To do so, add the following to your config file.

{
  "$schema": "https://raw.githubusercontent.com/RealShadowNova/typedoc-json-parser/main/assets/typedoc-json-parser.schema.json"
}

Example JSON file

{
  "$schema": "https://raw.githubusercontent.com/RealShadowNova/typedoc-json-parser/main/assets/typedoc-json-parser.schema.json",
  "json": "docs/api.json"
}

Example YAML file

json: 'docs/api.json'

Migrating JSON Files

If you need to migrate JSON files from a previous version of this package, you can use the migrate CLI flag. This will recursively search the provided directory for JSON files and migrate them to the latest version.

typedoc-json-parser --migrate docs

Node.js Usage

Once you have used the CLI to parse the TypeDoc JSON output, you'll want to use that data to create documentation. This package makes that extremely easy to do.

import { readFile } from 'node:fs';
import { resolve } from 'node:path';
import { ProjectParser } from 'typedoc-json-parser';

const data = JSON.parse(readFile(resolve(process.cwd(), 'docs', 'api.json'), 'utf8'));
const project = new ProjectParser({ data });

// Do something with the project

Documentation

While currently we do not have a dedicated way to view documentation for this package, you can still use the intellisense from your IDE and read our source code.