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

@snailicid3/node-utils

v0.2.0

Published

Node.js filesystem, path, zod schemas, and package.json utilities

Readme

@snailicid3/node-utils 🐌

npm license code style: prettier

Node.js filesystem, path, JSON, environment, process, and lightweight argv utilities.


TypeScript Node.js Zod

Repository

Author

👤 Gillian Tunney

Recommended package manager: pnpm

pnpm

@snailicid3/node-utils 🐌


Node-specific filesystem, path, JSON-file, environment, command, and lightweight argv utilities.

Release status: npm currently serves @snailicid3/[email protected]. The ownership changes in this checkout have not been released yet and are part of the four-package release rehearsal.

Installation

pnpm add @snailicid3/node-utils

The package exposes one ESM/CommonJS root entry and ./package.json.

Ownership boundary

Node-utils owns reusable Node primitives: file IO, path classification, glob filtering, process execution, environment parsing, entrypoint detection, and small argv normalization. It does not own repository policy, Git state, package scopes, or release workflows; those belong to @snailicid3/workspace. Runtime-neutral JSON value behavior belongs to @snailicid3/utils, while presentation belongs to @snailicid3/logger.

API groups

| Area | Representative exports | | ------------------- | ------------------------------------------------------------------------------------------------ | | Argument parsing | parseArgv, safeParseArgv, parseArgvObject, parseArgvPositionals | | Environment | defineEnv, getEnvironmentReportRows, reportEnvironment | | Commands | runCommand, runCommandOrThrow | | CLI entrypoints | isCallerEntrypoint, runCliIfEntrypoint, runCliIfEntrypointAsync | | JSON and objects | json, deepMerge, isPlainObject, JSON guards and branded serialization | | Filesystem and path | paths, filePath, typedPath, fsPath, fsTypedPath, path classifiers and existence checks | | Globs and media | filterFileArrByGlob, getImageBase64 |

Typed argument parsing

Use separate Zod schemas when a command has named options and positional arguments:

import { parseArgv } from '@snailicid3/node-utils'
import { hideBin } from 'yargs/helpers'
import { z } from 'zod'

const options = z.object({
  dryRun: z.boolean().default(false),
  tag: z.array(z.string()).default([]),
})
const positionals = z.tuple([z.string()])

const args = parseArgv(options, hideBin(process.argv), positionals)

console.log(args.options.dryRun, args.positionals[0])

Yargs performs token normalization without numeric coercion; the Zod schema controls coercion and transforms. Repeated options become arrays. safeParseArgv() returns a discriminated result instead of throwing a ZodError.

Typed environments

Environment definitions do not read process.env implicitly. Pass a source to parse() so library code and tests stay deterministic:

import { defineEnv, getEnvironmentReportRows } from '@snailicid3/node-utils'
import { z } from 'zod'

const environment = defineEnv({
  logLevel: z.enum(['debug', 'info']).default('info'),
  token: z.string().meta({ sensitive: true }),
})

const values = environment.parse(process.env)
const safeRows = getEnvironmentReportRows(environment, process.env)

Property names become uppercase underscore-separated environment keys unless a schema supplies meta({ environmentKey: '...' }). Values marked sensitive—and names that look credential-like—are redacted in reports.

Compatibility notes

  • node.exportJSONFile is a deprecated alias for json.exportFile.
  • Config retains compatibility re-exports for JSON-file and path helpers whose implementation now lives here.
  • file.path.array.ts#getFullPath and path.ts#getFullPath still have different semantics. Their consolidation is deliberately deferred until callers and filesystem-schema behavior are proved.

Release rehearsal

The shared candidate baseline is 68ab0564b2dc0f23b3ce3424beeb12225941c13d. Node-utils is first in the release-test dependency order. Pack the candidate, load its installed root through ESM and CommonJS, verify declaration routing, and exercise the argv, path, JSON-file, and environment surfaces from clean npm and pnpm consumers. The residual getFullPath duplication is a semantics-sensitive follow-up, not a registered Doctor fixture.

The Doctor MVP currently reports the root export map's missing explicit types condition as an unregistered finding. Unlike the deliberately retained example/logger fixtures, that is a release-gate defect to resolve or explicitly reclassify before rehearsing node-utils.

Repository maintenance

Node-utils extends TypeScript configuration published by @snailicid3/config. That is a static tooling relationship rather than a runtime dependency, so the package removes Nx's inferred config edge with implicitDependencies: ["!@snailicid3/config"]. Its build and typecheck targets still include the shared TypeScript-config directory as a cache input.

pnpm --filter=@snailicid3/node-utils build:nx
pnpm --filter=@snailicid3/node-utils test:nx
pnpm --filter=@snailicid3/node-utils api:report:nx