JSPM

br-dev-utils

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q9981F
  • License MIT

Utilitários essenciais para desenvolvimento no Brasil

Package Exports

  • br-dev-utils
  • br-dev-utils/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (br-dev-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

br-dev-utils

Essential utilities for development in Brazil. Validation, formatting and Brazilian data in TypeScript.

Instalação

npm install br-dev-utils

Uso

import { 
  validateCPF, 
  validateCNPJ, 
  formatCurrency, 
  getHolidays,
  fetchAddressByCEP 
} from 'br-dev-utils';

validateCPF('123.456.789-09');
validateCNPJ('11.222.333/0001-81');
formatCurrency(1500.50);
getHolidays(2025);
await fetchAddressByCEP('01310-100');

API

Validadores

  • validateCPF(cpf: string): boolean
  • validateCNPJ(cnpj: string): boolean
  • validateCEP(cep: string): boolean
  • validatePhone(phone: string): boolean

Formatadores

  • formatCPF(cpf: string): string
  • formatCNPJ(cnpj: string): string
  • formatCEP(cep: string): string
  • formatPhone(phone: string): string
  • formatCurrency(value: number): string

Dados

  • getHolidays(year: number): Holiday[]
  • isHoliday(date: string): boolean
  • brazilianStates: State[]

Serviços

  • fetchAddressByCEP(cep: string): Promise<CepResponse>

Licença

MIT