LacusSoft :: cnpj-val
Basic function to validate CNPJ (Brazilian ID document).
Browser Support
Latest |
Latest |
Latest |
Latest |
Latest |
11 |
Installation
$ npm install @lacussoft/cnpj-val
Import
// ES Modules
import cnpjVal from '@lacussoft/cnpj-val'
// Common JS
const cnpjVal = require('@lacussoft/cnpj-val')
or import it through your HTML file, using CDN:
<script src="https://cdn.jsdelivr.net/npm/@lacussoft/cnpj-val@latest/dist/cnpj-val.min.js"></script>
Usage:
cnpjVal('98765432000198') // returns 'true'
cnpjVal('98.765.432/0001-98') // returns 'true'
cnpjVal('98765432000199') // returns 'false'
^^