1.1.1 • Published 3 years ago

@lacussoft/cnpj-val v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

LacusSoft :: cnpj-val

NPM Latest Version Downloads Count Bundle Size Test Status Last Update Date Project License

Basic function to validate CNPJ (Brazilian ID document).

Browser Support

ChromeFirefoxSafariOperaEdgeIE
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'
                     ^^