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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ts-readme

v1.1.3

Published

Generate docs from typescript + jsdoc and put it in a README

Readme


  • Creates documentation for any exported entity
  • Combines JSDoc + TypeScript annotations
  • Includes parameters, return types, descriptions, and even example blocks

Installation

npm i ts-readme
# with yarn
yarn add ts-readme

Usage

Simply run ts-readme and it will pick up all the typescript files in your src folder and generate docs.

{
  "scripts": {
    "generate-docs": "ts-readme"
  }
}

And insert this block of code somewhere in your README.md:

<!-- INSERT GENERATED DOCS START -->

<!-- INSERT GENERATED DOCS END -->

Help

If you need any docs on ts-readme simply run the following from your terminal:

npx ts-readme --help

Targeting more files

ts-readme also supports targeting other files that might not be in src. Simply provide a glob to ts-readme and it will also generate docs for those files.

{
  "scripts": {
    "generate-docs": "ts-readme components/**/*.(ts|tsx)"
  }
}

Node API

You can use ts-readme as a normal node package too! This gives you finer grain control of where your docs are inserted!

generateMarkdown (function)

Generate the markdown docs a doc returned from getAllDocs

Parameters:

  • doc (TypeScriptDocument) - The TypeScript document to generate types for
  • headerDepth (number)

returns: string

getAllDocs (function)

Get the docs for all some files in the project.

Parameters:

  • pattern (string | string[]) - A glob pattern or patterns to match files from

returns: Promise<TypeScriptDocument[]>

createMatcher (function)

Create a markdown comment matcher. This matches the section where we will insert docs. Use this to create a custom section.

Parameters:

  • name (string) - The name to use in the markdown comment

returns: RegExp

GenerateOptions (interface)

Members:

  • matcher (RegExp) - A regex to match the part of the readme
  • pattern (string | string[]) - A glob pattern or patterns to match files from
  • headerDepth (number) - How deep the markdown headers should be

generate (function)

Generate all the docs and put it in the README.

Parameters:

  • options (GenerateOptions) - Options for generating the docs

returns: Promise

import generate, { createMatcher } from 'ts-readme';

generate({ matcher: createMatcher('TS-README-GENERATED') });

Contributing

To get set up developing this library run the following commands.

# Install deps
yarn

# Build the library in watch mode
yarn start

# Run the tests
yarn test && yarn lint

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!