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

@krainovsd/cli

v0.3.9

Published

Krainov cli

Downloads

1,013

Readme

@krainovsd/cli

translates

gen

Extracts translation keys from source code and merges them into a translation JSON file.

The search function (extractTranslationsContent) processes each file's content in two passes:

First pass — pattern — matches t() calls with a default value. The format depends on the framework:

  • vue: t("key", {}, { default: "value" }) — three arguments: key, options object, object with default
  • react: t("key", { defaultValue: "value" }) — two arguments: key and object with defaultValue

On a match, the key and default value are extracted. The key is added to the result if it hasn't been seen before. If the key was already found with a different value, a conflict warning is printed.

Second pass — patternSimple — matches t() calls without a default value. The format also depends on the framework:

  • vue: t("key"), t("key", { options }), t("key", { opt }, { opt }) — a broad pattern that matches calls with any number of object arguments
  • react: t("key"), t("key", { count: 5 }), t("key", { some: 0 }, { other: 1 }) — same broad pattern as vue

Since both patternSimple variants are broad and partially overlap with pattern, an additional filter patternSimpleInner is applied. It checks whether the matched call contains an object with default: (vue) or defaultValue: (react) — if so, the call was already handled by the first pass and is skipped.

On a match, the key is added with an empty value. If the key was already found by the first pass (with a non-empty value), a warning is printed.

DeduplicationseenKeys tracks all already processed keys. The first encountered key wins: if pattern found a key with a value and then patternSimple finds the same key, the simple variant is ignored. The reverse situation is also controlled via warnings, but priority remains with the first found occurrence.

After scanning all files, the collected entries (key + value) are converted from a flat list into a nested JSON object via makeTranslationJSON (key a.b.c becomes { "a": { "b": { "c": "value" } } }), then recursively merged into the existing translation file via mergeKeysRecursively — new keys are added, existing ones with the same type are overwritten, and a warning is printed on type mismatch.

diff

Compares two translation files (source and target) using SHA256 hashes. Creates a lock file to track changes: on the first run, an initial hash snapshot of the source file is generated; on subsequent runs, current hashes are compared against the saved ones. Keys with changed hashes are highlighted in green, keys with mismatched types in yellow. The result is written to result.json.

merge

Recursively merges source into target: new keys are added, existing strings are overwritten. On type mismatch (e.g. string vs object), a warning is printed and the source value overwrites the target.

exec-package-command

Runs a pnpm script in a specific package within a monorepo. Accepts an argument in the format <command:package-name> and an optional --prefix flag to scope the package name. Executes pnpm --filter <package> run <command> with stdin/stdout/stderr connected to the terminal.

check-package-duplicate

Parses pnpm-lock.yaml and finds duplicate packages across the monorepo. Two types of duplicates are detected: across importers (the same direct dependency resolved to different versions in different workspace packages) and within the lockfile itself (the same package resolved to multiple versions). The result is written to a JSON file with unique versions per package.

clear-dependencies

Recursively traverses a directory tree looking for package.json files and removes the associated node_modules and pnpm-lock.yaml. Stops recursing into subdirectories for packages without a pnpm-workspace.yaml (leaf packages). Silently ignores errors when trying to delete the running binary from its own node_modules.