under development, everything in the documentation is already implemented and working
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
pnpm
pnpm add 4devs
yarn
yarn add 4devs
npm
npm install --save 4devs
here you can see the documentation of all the features already implemented
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
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;
}
RG is one of the classes that 4devs has, this class is able to generate and validate a rg based on the services on the pages https://www.4devs.com.br/gerador_de_cpf and https://www.4devs.com.br/validador_rg
import { RG } from '4devs';
const { isValid } = await RG.validate({ rg: '30.737.817-2' });
parameters:
rg
(required) the RG you want to validate
return:
{
isValid: boolean;
}
import { RG } from '4devs';
const { rg } = await RG.generate({ isWithDots: true, stateCode: 'BA' });
parameters:
-
isWithDots
(optional) if true the RG will be generated with dots example: 30.737.817-2 if not generated without example: 307378172 -
stateCode
(optional) code of the state where the RG belongs, example: "BA" or "SP"
return:
{
rg: string;
}
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
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;
}
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 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
import { CNH } from '4devs';
const { isValid } = await CNH.validate({
cnh: '79973493843',
});
parameters:
cnh
(required) the cnh you want to validate
return:
{
isValid: boolean;
}
import { CNH } from '4devs';
const { cnh } = await CNH.generate();
return:
{
cnh: string;
}
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.