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

@kamaalio/codemods

v0.0.11

Published

A collection of codemods, runnable as a single CLI.

Readme

Codemods

A collection of codemods, runnable as a single CLI.

Available codemods

| Codemod | What it does | Reference | | ---------------- | ------------------------------------------------------------- | -------------------------------------------------- | | jest-to-vitest | Rewrite Jest tests and project config into Vitest equivalents | docs/jest-to-vitest.md | | joi-to-zod | Rewrite supported Joi schema patterns into Zod equivalents | docs/joi-to-zod.md |

Each codemod's reference documents what it transforms, its constraints, and its programmatic API.

codemods list prints the same table from the registry.

Usage

Run it without installing anything:

npx @kamaalio/codemods joi-to-zod ./src

Or install it globally:

npm install -g @kamaalio/codemods
codemods joi-to-zod ./src

The CLI takes the codemod name as its command, followed by a path:

codemods <codemod> [PATH] [FLAGS]

PATH may be a file or a directory, and defaults to ..

Flags

| Flag | Default | Description | | ---------- | ------- | ------------------------------------------------------------------------------- | | --dry | false | Print what would change without writing files | | --no-log | false | Disable log output | | --config | — | Path to a JSON config file listing the paths to migrate (see Config) |

--config and PATH are mutually exclusive: pass one or the other, not both.

Each flag also accepts a short form (-d, -n, -c) and its uppercase alias (-D, -N, -C).

Examples

# Transform the current directory
codemods joi-to-zod

# Transform a specific directory
codemods joi-to-zod src

# Transform a single file
codemods joi-to-zod src/schemas.ts

# Run a different codemod
codemods jest-to-vitest src

# Preview changes without writing them
codemods joi-to-zod src --dry

# Run quietly
codemods joi-to-zod src --no-log

# Transform the paths listed in a config file
codemods joi-to-zod --config joi-migration-phase1.json

# List the available codemods
codemods list

Config

For larger or staged migrations, pass --config with a JSON file listing the paths to transform instead of a single PATH:

{
  "paths": ["src/controllers"]
}

Each entry in paths is transformed the same way a positional PATH argument would be. The config file can also set dry_run to default that run to dry-run mode, without needing --dry on the command line, and log to control log output, without needing --no-log:

{
  "paths": ["src/controllers"],
  "dry_run": true,
  "log": false
}

Passing both --dry and a config dry_run at the same time is an error — pick one. The same applies to --no-log and a config log — pick one.

Library usage

Every codemod is exported for embedding in your own tooling. The transformer functions operate on source strings and never write files; only the CLI entry point touches disk.

import { run } from '@kamaalio/codemods';

await run(['joi-to-zod', 'src', '--dry']);

run accepts the same arguments as the codemods executable. It logs to the console and reports command failures through process.exitCode.

For a codemod's own exports — its string transformer, its Modifications transformer, and its codemod definition — see its reference: jest-to-vitest, joi-to-zod.

Development

Use pnpm on Node.js 26 (see .nvmrc). Install the pinned pnpm version with pnpm's standalone script:

curl -fsSL https://get.pnpm.io/install.sh | env PNPM_VERSION="$(jq -r '.devEngines.packageManager.version' package.json)" sh -
pnpm install
pnpm build
pnpm test

Every task lives in package.json — there is no task runner to install:

| Script | What it does | | ------------------------- | ---------------------------------------------------- | | pnpm bootstrap | Install dependencies from the lockfile | | pnpm build | Compile src/ to dist/ with tsc | | pnpm clean:build | Remove dist/ and rebuild | | pnpm test | Run the test suite once | | pnpm test:watch | Run the test suite in watch mode | | pnpm test:cov | Run the test suite with coverage | | pnpm test:u | Update snapshots | | pnpm test:example | Run the example/ behavioural tests | | pnpm type-check | Type-check src/ | | pnpm type-check:test | Type-check tests and scripts | | pnpm type-check:example | Type-check example/ | | pnpm lint | Lint with oxlint | | pnpm format | Format with oxfmt | | pnpm format:check | Check formatting | | pnpm quality | Lint, format check, and both type checks | | pnpm preview | Run the CLI against test/resources in dry-run mode | | pnpm transform:example | Run the CLI against example/ | | pnpm new:codemod <name> | Scaffold a new codemod | | pnpm release <version> | Publish to npm |

Contributing

Adding a codemod takes about ten minutes. See CONTRIBUTING.md.

License

MIT. See LICENSE.