0.0.0-dev • Published 6 years ago
@andrerds/cnpj-fork v0.0.0-dev
CNPJ
Consulta de CNPJ is Fork @rafaelrabaco
Installation
To install it, use the following command:
$ npm install --save andrerds/cnpj-fork
If you're using Yarn
$ yarn add andrerds/cnpj-fork
Usage
Consult
Returns the information of the CNPJ
import { CNPJ } from 'andrerds/cnpj-fork';
CNPJ.info('27865757000102')
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
CNPJ.info('27.865.757/0001-02', {
'token': 'TOKEN RECEITAWS' // Optional Pagando funciona com Api OFICIAL
'timeout': 5000 // Optional (Default: 3000)
})
.then(response => {
console.log(response);
})
.catch(err => {
console.log(err);
});
Validate
Checks if it is a valid CNPJ
import { CNPJ } from 'andrerds/cnpj-fork';
CNPJ.validate('56.112.478/0001-68'); // true
CNPJ.validate('56112478000168'); // true
CNPJ.validate('12.033.793/0001-12'); // false
CNPJ.validate('12033793000112'); // false
CNPJ.validate('22.480.042/0001-00'); // true
Clean
Removes non-numeric characters.
import { CNPJ } from 'andrerds/cnpj-fork';
CNPJ.clear('43.236.279/0001-10'); // 43236279000110
Format
Add non-numeric characters.
import { CNPJ } from 'andrerds/cnpj-fork';
CNPJ.format('43236279000110'); // 43.236.279/0001-10
0.0.0-dev
6 years ago
1.0.0
6 years ago
1.0.5
6 years ago
1.0.3
6 years ago
1.0.2-development
6 years ago
1.0.1-development
6 years ago
1.0.0-development
6 years ago