validocs

Library for document and pattern validation

Usage no npm install needed!

<script type="module">
  import validocs from 'https://cdn.skypack.dev/validocs';
</script>

README

Validocs

Validocs library for document and pattern validation.

Features

The current list of documents and patterns implemented on this project are:

  • CPF
    Cadastro Pessoas Físicas (brazilian federal document required for natural persons)
  • CNPJ
    Cadastro Nacional de Pessoas Jurídicas (brazilian federal document required for legal persons)
  • PIS
    Programa de Integração Social (brazilian federal document required for natural persons)

Collaborators

License

This project is licensed under the terms of the MIT license.

Quickstart

Install

$ npm install validocs --save

Usage

Typescript example:

Import and use a module:

import CPF from 'validocs/cpf';

const cpf: CPF.Cpf = CPF.make();

console.log(`Generated CPF number: ${cpf}`);

Documentation

The projects wiki is available at github.