Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A node module to gen, validate and format Brazilian documents' numbers (aka CPF/CNPJ).
JavaScript
branch: master
Failed to load latest commit information.
dist
lib
test
.gitignore add cpf checksum
.jshintrc
Gruntfile.js improve code quality
LICENSE-MIT
README.md add code climate badge
index.js add dist
package.json 0.2.6

README.md

bradoc Code Climate

A node module to gen, validate and format Brazilian documents numbers.

Getting Started

Install the module with

npm install bradoc

Use the module

var bradoc = require('bradoc');

Generators and Validators for CPF and CNPJ are available.

CPF

To generate a valid CPF (also formatted)

bradoc.cpf.generate(); 

To validate a CPF (formatted or not)

bradoc.cpf.validate('423oiu423iu42'); 

CNPJ

To generate a valid CNPJ (also formatted)

bradoc.cnpj.generate(); 

To validate a CNPJ (formatted or not)

bradoc.cnpj.validate('423oiu423iu42'); 

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Lint and test your code using Grunt. For that, watch the files to lint it automagically with:

grunt watch

License

Copyright (c) 2013 Jú Gonçalves
Licensed under the MIT license.

Something went wrong with that request. Please try again.