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

@lcabrera/utils

v0.1.1

Published

Pure, framework-agnostic TypeScript utilities — no side effects, no dependencies, browser or server.

Downloads

279

Readme

@lcabrera/utils

Shared, framework-agnostic pure utilities for the monorepo — the lowest layer, importable by any consumer (@lcabrera/ui, @lcabrera/server, apps). No React/DOM/StyleX, no fetch/node:*/pg/db, no side effects.

Install

npm install @lcabrera/utils

No dependencies and no peer dependencies.

Inside this monorepo, depend on it with "@lcabrera/utils": "workspace:*" and run vp install from the root.

Current exports

Sources live under src/, grouped by domain, with an explicit per-file subpath export for each helper:

| Domain | Helper | Import | | ------------ | --------------------------------------------------------------------------------------- | -------------------------------------------------------------- | | arrays | mergeArrays | @lcabrera/utils/arrays/merge-arrays.util | | comparison | areArraysEqual | @lcabrera/utils/comparison/are-arrays-equal.util | | comparison | areEqualByJson | @lcabrera/utils/comparison/are-equal-by-json.util | | comparison | isShallowEqual | @lcabrera/utils/comparison/is-shallow-equal.util | | errors | getErrorMessage | @lcabrera/utils/errors/get-error-message.util | | errors | toError | @lcabrera/utils/errors/to-error.util | | formatters | formatCurrency | @lcabrera/utils/formatters/format-currency.util | | formatters | formatDate | @lcabrera/utils/formatters/format-date.util | | formatters | formatNumber | @lcabrera/utils/formatters/format-number.util | | formatters | parseDate | @lcabrera/utils/formatters/parse-date.util | | formatters | getDateTimeFormatOptions | @lcabrera/utils/formatters/get-date-time-format-options.util | | formatters | getDefaultLocale | @lcabrera/utils/formatters/get-default-locale.util | | formatters | DEFAULT_CURRENCY, DEFAULT_DATE_PRESET, DEFAULT_LOCALE | @lcabrera/utils/formatters/formatters.constants | | formatters | CurrencyFormatOptions, DateFormatOptions, DateFormatPreset, NumberFormatOptions | @lcabrera/utils/formatters/formatters.types | | forms | isCheckboxChecked | @lcabrera/utils/forms/is-checkbox-checked.util | | forms | readFormString | @lcabrera/utils/forms/read-form-string.util | | guards | isObject | @lcabrera/utils/guards/is-object.util | | json | safeJsonParse | @lcabrera/utils/json/safe-json-parse.util | | numbers | parsePositiveInteger | @lcabrera/utils/numbers/parse-positive-integer.util | | numbers | roundToCents | @lcabrera/utils/numbers/round-to-cents.util | | objects | dropNullishValues | @lcabrera/utils/objects/drop-nullish-values.util | | objects | mergeObjects | @lcabrera/utils/objects/merge-objects.util | | strings | emptyToUndefined | @lcabrera/utils/strings/empty-to-undefined.util |

import { getErrorMessage } from '@lcabrera/utils/errors/get-error-message.util';
import { isShallowEqual } from '@lcabrera/utils/comparison/is-shallow-equal.util';

@lcabrera/utils is side-effect free ("sideEffects": false) to keep tree-shaking effective; each helper is a standalone subpath so consumers pull in exactly one. It is published as compiled ESM (.mjs + .d.mts) with source maps, mirroring the source tree one file per module.

Adding a utility

Create a kebab-case *.util.ts file under the matching domain folder in src/ (e.g. src/strings/, src/guards/) with a colocated *.util.test.ts, then add an explicit subpath to the exports map in package.json:

{
  "exports": {
    "./strings/slugify.util": "./src/strings/slugify.util.ts"
  }
}

Then import it anywhere:

import { slugify } from '@lcabrera/utils/strings/slugify.util';

Guidelines

  • All functions must be pure — same input → same output, no side effects, no argument mutation.
  • No framework imports (react, vite, pg, node:*, …) — this package stays runtime-agnostic and browser-or-server safe. tsconfig denies Node ambient globals (types: []) so a stray process/fs reach-in fails typecheck.
  • Named exports only, never export default.
  • kebab-case *.util.ts, one util per file, grouped by domain under src/. Enforced by local-rules/filename-convention via its suffixCase option (the rule stays live — a camelCase .util here fails the gate; it is not turned off).
  • ≥95% coverage (statements/branches/functions/lines), gated by test:coverage. This is a public-facing package: it never baselines and is suppression-free by construction (its eslint-suppressions.json is gitignored).

Links

MIT © Lucio Cabrera