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

@brazilian-utils/brazilian-utils

v2.4.0

Published

Zero-dependency, tree-shakeable TypeScript utilities for Brazilian data: validate, format, parse and generate CPF, CNPJ, CEP, boleto, Pix, phone, holidays and more.

Readme

📖 Documentation

npm version Downloads per month License: MIT Zero dependencies Bundle size TypeScript Build Status Tests codecov Mutation tests OpenSSF Scorecard

Table of Contents

Getting Started

Brazilian Utils is a library focused on solving problems that we face daily in the development of applications for the Brazilian business.

Why Brazilian Utils

  • Zero runtime dependencies. Nothing else lands in your node_modules or in your bundle.
  • Tree-shakeable, down to the function. import { isValidCpf } costs about 1.4 KB minified (0.8 KB gzipped); every util is also its own subpath entry (@brazilian-utils/brazilian-utils/get-cities) for the heavy ones.
  • Runs everywhere. Node.js ^20.19.0 || >=22.12.0, Bun, Deno and evergreen browsers, tested in CI on every one of them.
  • Written in TypeScript. Types ship with the package; the public API is tracked by an API report so nothing changes silently.
  • Validated against the official rules. Every validator cites the specification, law or dataset it implements (@see in the docs), and the test suite is mutation-tested, not just covered.
  • Documented in English and Portuguese, with an llms.txt for AI assistants.

Installation

You can install Brazilian Utils in a few ways:

as npm package:

npm install --save @brazilian-utils/brazilian-utils

with yarn package manager:

yarn add @brazilian-utils/brazilian-utils

with pnpm:

pnpm add @brazilian-utils/brazilian-utils

with bun:

bun add @brazilian-utils/brazilian-utils

or <script> tag (global BrazilianUtils):

<script src="https://unpkg.com/@brazilian-utils/brazilian-utils/dist/brazilian-utils.umd.cjs"></script>

Runtime support

The supported range is the engines field in package.json; every row below is exercised by the Tests workflow on every pull request.

| Runtime | Supported | Covered in CI | | -------- | ------------------------- | ----------------------------- | | Node.js | ^20.19.0 \|\| >=22.12.0 | 20, 22, 24, 26 | | Bun | latest | latest | | Deno | 2.x | 2.x | | Browsers | evergreen | Chrome, Firefox, Edge, Safari |

Usage

To use a utility, import the required function, as shown below:

import { isValidCpf } from "@brazilian-utils/brazilian-utils";

isValidCpf("1232454233345"); // false

You can check a list of utilities by clicking here.

  • The package is tree-shakeable. Every util is also available as its own subpath (e.g. @brazilian-utils/brazilian-utils/get-cities) so you can lazy-load the few heavy ones. See Bundle size.

Development

This repository uses Vite+ as the local toolchain; it is installed as a dependency, so nothing has to be installed globally beyond Node.js 24 (the version in .nvmrc, which the toolchain needs; the library itself supports Node.js ^20.19.0 || >=22.12.0).

npm install
npm run check
npm test
npm run build

CONTRIBUTING.md lists every script and the checks a pull request goes through.

Release notes are published through GitHub Releases.

Contributors

Our "thank you" goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind are welcome!

License

MIT