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

@codemastersolutions/codedev

v0.0.3

Published

CodeDev CLI - Developer tools with zero runtime dependencies.

Readme

CodeDev CLI

Developer tools CLI with zero runtime dependencies.

npm version npm downloads license node PR Checks Release CodeQL Coverage Status

Global Install

pnpm add -g @codemastersolutions/codedev

Outros gerenciadores de pacotes:

  • npm: npm i -g @codemastersolutions/codedev
  • yarn: yarn global add @codemastersolutions/codedev
  • bun: bun add -g @codemastersolutions/codedev

Após instalar globalmente:

codedev generate cpf -f
codedev v cpf 529.982.247-25
cdev generate cnpj -f
cdev val cnpj 12.345.678/0001-95

Nota: mesmo com o pacote escopado (@codemastersolutions/codedev), os executáveis instalados continuam sendo codedev e cdev.

Usage

codedev generate cpf --formatted
codedev generate cnpj -f

codedev validate cpf 529.982.247-25
codedev validate cnpj 12.345.678/0001-95

# você também pode usar o alias de bin:
cdev g cpf -f
cdev v cnpj 12.345.678/0001-95

CLI Help & Saída

  • Comandos: generate <cpf|cnpj> [--formatted|-f], validate <cpf|cnpj> <value>
  • Aliases: generateg, gen; validatev, val
  • Saída de validate: imprime valid ou invalid e retorna 0 ou 1 respectivamente
  • Formatação: --formatted/-f aplica pontuação ao documento gerado (apenas em generate)
  • Compatibilidade: aceita --formated/--format por compatibilidade

Run via pnpm dlx

Execute sem instalar globalmente, ideal para uso pontual:

pnpm dlx @codemastersolutions/codedev generate cpf -f
pnpm dlx @codemastersolutions/codedev v cpf 529.982.247-25
pnpm dlx @codemastersolutions/codedev generate cnpj -f
pnpm dlx @codemastersolutions/codedev val cnpj 12.345.678/0001-95

Alternativas com outros package managers:

  • npm (npx):
    • npx @codemastersolutions/codedev generate cpf -f
    • npx @codemastersolutions/codedev v cpf 529.982.247-25
  • yarn (dlx):
    • yarn dlx @codemastersolutions/codedev generate cnpj -f
    • yarn dlx @codemastersolutions/codedev val cnpj 12.345.678/0001-95
  • bun (bunx):
    • bunx @codemastersolutions/codedev generate cpf -f
    • bunx @codemastersolutions/codedev v cnpj 12.345.678/0001-95

Nota: mesmo via pnpm dlx com pacote escopado, os executáveis disponibilizados permanecem codedev e cdev.

Aliases

# generate aliases
codedev g cpf --formatted
codedev gen cnpj --formatted

# validate aliases
codedev v cpf 529.982.247-25
codedev val cnpj 12.345.678/0001-95

Flags

--formatted   Output with formatting (preferred)
-f            Short flag alias for formatted output

Nota: o parser aceita --formated por compatibilidade, mas não é recomendado.

Library API

O pacote é dual-target: ESM e CommonJS, com tipagens em dist/types. Node >=18 é requerido.

ESM (TypeScript / Node 18+)

import {
  generateCPF,
  isValidCPF,
  formatCPF,
  generateCNPJ,
  isValidCNPJ,
  formatCNPJ,
} from "@codemastersolutions/codedev";

const cpf = generateCPF(true);
const isCpfValid = isValidCPF(cpf);

// formatação explícita
const rawCpf = generateCPF(false);
const prettyCpf = formatCPF(rawCpf);

const cnpj = generateCNPJ();
const isCnpjValid = isValidCNPJ(cnpj);
const prettyCnpj = formatCNPJ(cnpj);

Geração de CPF por UF (Estado)

Você pode fixar o dígito regional do CPF informando a UF (estado):

import { generateCPF, isValidCPF } from "@codemastersolutions/codedev";

// São Paulo (SP → dígito regional 8)
const cpfSP = generateCPF({ formatted: true, uf: "SP" });
console.log(cpfSP); // ex.: 123.456.789-09
console.log(isValidCPF(cpfSP)); // true

// Rio de Janeiro (RJ → dígito regional 7) e Rio Grande do Sul (RS → 0)
const cpfRJ = generateCPF({ uf: "RJ" });
const cpfRS = generateCPF({ uf: "RS" });

Observações:

  • generateCPF(true) e generateCPF(false) continuam funcionando como antes.
  • Para escolher UF, use a forma com objeto: generateCPF({ formatted?: boolean; uf?: UF }).
  • A CLI atualmente não recebe UF; utilize a API de biblioteca para essa necessidade.

Consumidores CommonJS podem usar require('@codemastersolutions/codedev') para importar as mesmas funções.

Uso local (sem instalação global)

Se o pacote estiver instalado como devDependency no projeto:

pnpm exec codedev generate cpf -f
pnpm exec cdev val cnpj 12.345.678/0001-95

Nota: com instalação local, os bins disponíveis continuam sendo codedev e cdev, independentemente do escopo do pacote.

Build

Outputs CommonJS to dist/cjs and ESM to dist/esm. Types are emitted to dist/types.

pnpm build

Test & Lint

pnpm lint
pnpm test:coverage

Com outros gerenciadores de pacotes:

  • npm: npm run lint e npm run test:coverage
  • yarn: yarn lint e yarn test:coverage
  • bun: bun run lint e bun run test:coverage

CI/CD

  • PRs to dev run lint, tests (coverage ≥90%), and security audit.
  • Merged PRs to main run tests, bump version, tag, create release, and publish to npm (only compiled artifacts).

Publishing

Only compiled files (dist/**), README and LICENSE are published.