1.2.4 • Published 2 years ago

node-cpf v1.2.4

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

CPF npm Downloads Package Quality License

Utilities functions to handle brazilian CPF.

Installation

npm install node-cpf --save

Examples

CPF Validation

const cpf = require('node-cpf');

cpf.validate('226.088.422-91'); // returns TRUE
cpf.validate('22608842291');    // returns TRUE

cpf.validate('11111111111'); // returns FALSE

CPF Mask

const cpf = require('node-cpf');

cpf.mask('22608842291'); // returns '226.088.422-91'

CPF UnMask

const cpf = require('node-cpf');

cpf.unMask('226.088.422-91'); // returns '22608842291'

CPF Is Masked

const cpf = require('node-cpf');

cpf.isMasked('226.088.422-91'); // returns TRUE
cpf.isMasked('22608842291');    // returns FALSE

Random CPF Generation

const cpf = require('node-cpf');

cpf.generate();     // returns a valid CPF without mask
cpf.generate(true); // returns a valid CPF with mask

Test and development

  • Install external dependencies: npm install
  • Run the test suite without coverage: npm test
  • Run the test suite with coverage: npm run testdox

How to Contribute

  • Open a pull request or an issue about what you want to implement / change. We're glad for any help!
  • Please be aware that we'll only accept fully tested code.

Contributors

LICENSE

Copyright (c) 2017-2022 Leonardo Thibes

The MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1.2.0

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.21

5 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago