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

repopo

v0.8.0

Published

Enforce policies on all or some of the files in a git repository.

Readme

repopo - police the files in your git repo with extensible policies

repopo is a tool to apply policies to the files in your git repo. You can think of it as a sort of lint tool for any file in your git repo, with a straightforward way to write your own policies.

Configuring policies

Repopo and its policies can be configured in a repopo.config.ts (or .cjs, or .mjs) file in the root of the repo. Using a TypeScript configuration file is recommended.

The policy config must export a default object of the type PolicyConfig.

Excluding files from policy check

By default, all files in the repo are checked. You can exclude files completely from the policy check by configuring the d excludeFiles setting. It should be an array of strings/regular expressions. Paths that match any of these expressions will be completely excluded from all policies.

You can exclude files from individual policies as well by configuring the excludeFiles setting when calling makePolicy.

Configuring individual policies

Individual policies can be configured by passing configuration settings to a PolicyDefinition in makePolicy.

Included policies

repopo includes the following policies. All of the included policies are enabled by default.

HtmlFileHeaders and JsTsFileHeaders

These policies set a common file header for JavaScript/TypeScript and HTML files.

Configuration

TODO

NoJsFileExtensions

The NoJsFileExtensions policy checks for JavaScript source files that just use the .js file extension. Such files may be interpreted by Node.js as either CommonJS or ESM based on the type field in the nearest package.json file. This can create unexpected behavior for JS files; changing the package.json nearest to one will change how the JS is processed by node. Using explicit file extensions reduces ambiguity and ensures a CJS file isn't suddenly treated like an ESM file.

PackageJsonProperties

The PackageJsonProperties policy is used to enforce fields in package.json files across the repo.

Configuration

The verbatim setting requires that all the configured fields in package.json match the values in the configuration.

import type { PolicyConfig } from "@tylerbu/repopo";
const config: PolicyConfig = {
	policySettings: {
		PackageJsonProperties: {
      // This setting will force all package.json files to contain these fields with the exact configured values.
			verbatim: {
				license: "MIT",
				author: "Tyler Butler <[email protected]>",
				bugs: "https://github.com/tylerbutler/tools-monorepo/issues",
				repository: {
					type: "git",
					url: "git+https://github.com/tylerbutler/tools-monorepo.git",
				}
			}
		}
	}
};

PackageJsonRepoDirectoryProperty

A RepoPolicy that checks that the repository.directory property in package.json is set correctly. If the repository field is a string instead of an object the package will be ignored.

Policy generators

There are some filetypes that often have policies applied to them, like package.json. You can use the policy generator functions to generate policies for those filetypes. Using the generators is not required; they simply reduce the amount of boilerplate code you have to write for a policy.

generatePackagePolicy

Use generatePackagePolicy to generate policies for package.json files.

CLI Usage

repopo check

Checks and applies policies to the files in the repository.

USAGE
  $ repopo check [-v | --quiet] [-f] [--stdin]

FLAGS
  -f, --fix    Fix errors if possible.
      --stdin  Read list of files from stdin.

LOGGING FLAGS
  -v, --verbose  Enable verbose logging.
      --quiet    Disable all logging.

See code: src/commands/check.ts

repopo list

Lists the policies configured to run.

USAGE
  $ repopo list [-v | --quiet]

LOGGING FLAGS
  -v, --verbose  Enable verbose logging.
      --quiet    Disable all logging.

See code: src/commands/list.ts