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

@tomfanhm/ts-lib-starter

v0.0.1

Published

A production-ready TypeScript library starter

Readme

@tomfanhm/ts-lib-starter

A production-ready TypeScript library starter with dual ESM/CJS output, comprehensive testing, and automated publishing.

Installation

npm install @tomfanhm/ts-lib-starter
# or
pnpm add @tomfanhm/ts-lib-starter
# or
yarn add @tomfanhm/ts-lib-starter

Usage

ESM

import { add, capitalize, slugify } from "@tomfanhm/ts-lib-starter";

add(2, 3); // 5
capitalize("hello"); // "Hello"
slugify("Hello World!"); // "hello-world"

CJS

const { add, capitalize, slugify } = require("@tomfanhm/ts-lib-starter");

add(2, 3); // 5
capitalize("hello"); // "Hello"
slugify("Hello World!"); // "hello-world"

API

Math

| Function | Description | | ---------------- | --------------------------------------------------------------- | | add(a, b) | Returns the sum of two numbers | | subtract(a, b) | Returns the difference of two numbers | | multiply(a, b) | Returns the product of two numbers | | divide(a, b) | Returns the quotient (throws DivisionByZeroError if b is 0) |

String

| Function | Description | | ----------------------------------- | --------------------------------------- | | capitalize(str) | Uppercases the first letter | | slugify(str) | Converts to a URL-friendly slug | | truncate(str, maxLength, suffix?) | Truncates with suffix (default "...") |

Errors

| Class | Description | | --------------------- | -------------------------------------- | | LibraryError | Base error with code field | | DivisionByZeroError | Thrown by divide() when divisor is 0 |

Full API documentation: run pnpm run docs to generate Typedoc output in docs/.

Development

# Install dependencies
pnpm install

# Run in watch mode
pnpm run dev

# Run tests
pnpm run test

# Run tests in watch mode
pnpm run test:watch

# Run tests with coverage
pnpm run test:coverage

# Lint and format
pnpm run lint
pnpm run lint:fix

# Type-check
pnpm run type-check

# Build
pnpm run build

# Full quality check
pnpm run quality

Scripts

| Script | Description | | --------------- | -------------------------------------------------------------------- | | build | Bundle with tsup (ESM + CJS) | | dev | Build in watch mode | | test | Run tests with Vitest | | test:watch | Run tests in watch mode | | test:coverage | Run tests with V8 coverage | | lint | ESLint + Prettier check | | lint:fix | Auto-fix lint and format issues | | format | Format with Prettier | | type-check | TypeScript type checking | | docs | Generate Typedoc documentation | | quality | Full quality pipeline (lint, type-check, test, build, publint, attw) |

Changesets

This project uses Changesets for versioning.

To add a changeset:

pnpm run changeset

Follow the prompts to describe your change. When PRs with changesets are merged to main, the release workflow automatically creates a version PR. Merging that PR publishes to NPM.

Publishing

Publishing is automated via GitHub Actions:

  1. Create a changeset: pnpm run changeset
  2. Commit and push to a feature branch
  3. Merge the PR to main
  4. The release workflow creates a "Version Packages" PR
  5. Merge the version PR to publish to NPM

For manual publishing:

pnpm run release

License

MIT