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

@onrails/codemod

v0.2.1

Published

Codemods for migrating onto @onrails/result (neverthrow → compat shim, and beyond)

Readme

@onrails/codemod

Bun-based codemods for migrating onto @onrails/result.

Install

bun add -d @onrails/codemod

Or run without installing:

bunx @onrails/codemod /path/to/target-repo --dry

What it does

By default, rewrites every from "neverthrow" import and every neverthrow package.json dep to point at @onrails/result/compat/neverthrow.

  • Walks .ts / .tsx / .mts / .cts. Skips node_modules, dist, .git, .next, .turbo, coverage, build.
  • Rewrites only the specifier in import / from / import(...); string mentions of "neverthrow" in regular code are left alone.
  • Updates dependencies / devDependencies / peerDependencies in every nested package.json that lists neverthrow, replacing it with @onrails/result at a path relative to that package.json.
  • Idempotent. Safe to re-run.

With --to-native, rewrites safe @onrails/result/compat/neverthrow imports to native @onrails/result imports, then rewrites supported sync method chains to native pipe(...) calls. This mode also reports TODO lines for compat-only properties and unsupported import shapes that still need manual migration.

Usage

# dry run
bunx @onrails/codemod /path/to/target-repo --dry

# apply
bunx @onrails/codemod /path/to/target-repo

# point at a local @onrails/result checkout (file: install)
bunx @onrails/codemod /path/to/target-repo \
  --onrails=/Users/me/dev/onrails/packages/result

# stage 2: compat shim -> native imports
bunx @onrails/codemod /path/to/target-repo --to-native --dry
bunx @onrails/codemod /path/to/target-repo --to-native

After applying:

cd target-repo
rm -rf node_modules/.bun/@onrails* node_modules/@onrails   # force-refresh file: deps if using a local checkout
bun install
bun typecheck
bun test

Native migration

--to-native is intentionally conservative. It rewrites imports that have a native equivalent:

import { ok, err, Result } from "@onrails/result/compat/neverthrow";

becomes:

import { ok, err } from "@onrails/result";
import type { Result } from "@onrails/result";

It does not rewrite arbitrary method chains or namespace/re-export shapes yet. The CLI rewrites supported sync chains such as:

ok(1).map(double).andThen(validate).orElse(recoverInput);

to:

pipe(ok(1), map(double), flatMap(validate), recover(recoverInput));

Terminal .match(...) and .unwrapOr(...) become data-first native calls. ResultAsync-looking chains stay method-style because the native async API already supports those methods. The CLI still reports TODO lines for compat-only surface such as .isOk(), .value, Result.fromThrowable(...), import * as neverthrow from ..., and export { ok } from ....

Roadmap

  • Generalized rename codemod (any from "A"from "B" + deps): planned.
  • AST-backed compat method-chain rewrite to pipe(...) / fluent(...): planned.

License

MIT