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

@snickbit/readmes

v0.0.28

Published

A ReadMe generator for monorepos. Generates a list of packages and attempts to pull their description using readme comment blocks.

Downloads

4

Readme

@snickbit/readmes

Minimal monorepo readme generator. Generates a list of packages and attempts to pull their description using readme comment blocks.

NOTE: This is primarily for my own use. Use it at your own risk.

Installation

pnpm -g add @snickbit/readmes
yarn global add @snickbit/readmes
npm -g add @snickbit/readmes

Configuration

Configuration Locations

readmesrc.json
readmesrc.js
readmesrc.cjs
readmes.config.js
readmes.config.cjs
package.json "readmes" property

Configuration Options

{
	// Globs of packages to include in the readme.
	// Globs should either point to the root of the package or to the README.md file.
	"packages": [
		"packages/*",
		"apps/*"
	],
	// The repo to use for the readme.
	"repo": "github-username/github-repo",
	
	// Your directories will be used as categories
	// You can rename the categories here with key/value pairs.
	"renameCategories": {
		"packages": "libraries"
	},
	
	// If you have a different root directory path, define it here
	"root": "root/directory/path",
	
	// Template to use for linking to files or packages in the repo. 
	// The following variables are available:
	// - `{repo}`: The repo name.
	// - `{packagePath}`: The path to the file or package.
	// - `{name}`: The name of the package from the package.json file.
	// - `{workspace}`: (polyrepo only) The workspace name.
	// - `{category}`: The category of the package, usually the directory name.
	"repoUrlTemplate": "https://github.com/{{repo}}/tree/main/{{packagePath}}"
}

Typical Monorepo

You don't need to define the "packages" configuration if you are using the "typical" monorepo file structure.

project
├── packages
│   ├── package-a
│   ├── package-b
│   ├── package-c
│   └── package-d
└── package.json
└── README.md
{
	"repo": "snickbit/snickbit.js"
}

Custom Monorepo

If you are using some a different file structure, you can define it in the configuration

{
	"packages": [
		"projects/*",
		"packages/*",
		"path/to/package/directory",
		"path/to/package/README.md"
	]
}

Polyrepo

You can also use this for polyrepo setups, or poly-monorepo setups.

{
	"root": {
		"packages": [
			"*"
		],
		"repo": "."
	},
	"project-a": {
		"packages": [
			"path/to/project-a/package"
		],
		"repo": "project-a"
	},
	"project-b": {
		"packages": [
			"project-b/packages/*"
		],
		"repo": "project-b"
	}
}

Usage

Package README

For each package, create your normal README.md file. Then wrap your description with tagged comment blocks.

START_SECTION:readmes-description END_SECTION:readmes-description

<!--START_SECTION:readmes-description-->

This is my super cool package 

<!--END_SECTION:readmes-description-->

Root README

Then in your root package, add comment blocks where you want to insert the packages and table of contents.

START_SECTION:readmes-toc END_SECTION:readmes-toc

START_SECTION:readmes-packages END_SECTION:readmes-packages

<!--START_SECTION:readmes-toc-->

Be careful of what you put in here. It will be erased by the generator!

<!--END_SECTION:readmes-toc-->

<!--START_SECTION:readmes-packages-->

Be careful of what you put in here. It will be erased by the generator!

<!--END_SECTION:readmes-packages-->

Generating the README

Then in the root package, run the generator.

readmes

License

Copyright (c) 2022 - Nicholas Lowe aka Snickbit

MIT License