1.3.0 • Published 2 years ago

4devs v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

under development, everything in the documentation is already implemented and working

Quick Start

npm package that generates and validates: Birth Certificate, CNH, Bank Account, CPF, Resume, Nicks, PIS/PASEP, CNPJ, CEP, RG, Voter Title, Credit Card, documents of people, Image and much more...

import { CPF } from '4devs';

const { cpf } = await CPF.generate(); // 34317074087

await CPF.validate({ cpf: '999.999.999-99' }); // false

Installation

yarn

yarn add 4devs

npm

npm install --save 4devs

Navigation

Docs:

here you can see the documentation of all the features already implemented

CPF:

CPF is one of the classes that 4devs has, this class is able to generate and validate a cpf based on the services on the pages https://www.4devs.com.br/gerador_de_cpf and https://www.4devs.com.br/validador_cpf

validate a CPF

import { CPF } from '4devs';

const { isValid } = await CPF.validate({ cpf: '577.572.660-09' });

parameters:

  • cpf (required) the CPF you want to validate

return:

{
  isValid: boolean;
}

generate a new CPF

import { CPF } from '4devs';

const { cpf } = await CPF.generate({ isWithDots: true, stateCode: 'BA' });

parameters:

  • isWithDots (optional) if true the CPF will be generated with dots example: 218.61.715-34 if not generated without example: 60778779564

  • stateCode (optional) code of the state where the CPF belongs, example: "BA" or "SP"

return:

{
  cpf: string;
}

Certificates:

Certificates is one of the classes that 4devs has, this class is able to generate and validate a certificates based on the services on the pages https://www.4devs.com.br/validador_certidoes and https://www.4devs.com.br/gerador_numero_certidoes

validate a Certificates

import { Certificates } from '4devs';

const { isValid } = await Certificates.validate({
  certificate: '107211 01 55 2018 1 07592 378 3808990-80',
});

parameters:

  • certificate (required) the certificate you want to validate

return:

{
  isValid: boolean;
}

generate a new Certificate

import { Certificates } from '4devs';

const { certificate } = await Certificates.generate({
  isWithDots: true,
  type: 'BIRTH',
});

parameters:

  • isWithDots (optional) if true the certificate will be generated with dots example: 107211 01 55 2018 1 07592 378 3808990-80 if not generated without example: 21931801552017107907909207153815

  • type (optional) the certificate type, can be: 'BIRTH' | 'WEDDING' | 'RELIGIOUS_MARRIAGE' | 'DEATH'

return:

{
  certificate: string;
}

CNH:

CNH is one of the classes that 4devs has, this class is able to generate and validate a CNH based on the services on the pages https://www.4devs.com.br/validador_cnh and https://www.4devs.com.br/gerador_de_cnh

validate a CNH

import { CNH } from '4devs';

const { isValid } = await CNH.validate({
  cnh: '79973493843',
});

parameters:

  • cnh (required) the cnh you want to validate

return:

{
  isValid: boolean;
}

generate a new CNH

import { CNH } from '4devs';

const { cnh } = await CNH.generate();

return:

{
  cnh: string;
}

Footer:

This package is created using the website https://www.4devs.com.br. but the site has no responsibility for this content it was made in an open source way and without contacting the site.