Wondering what’s next for npm?Check out our public roadmap! »

    biobe-validators
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.2 • Public • Published

    biobe-validators

    Getting started

    Install with NPM

    $ npm install biobe-validators --save
    

    Install with Yarn

    $ yarn add biobe-validators
    

    How to use with ES6

    CPF

    import { cpfValidation } from "biobe-validators";
     
    // No points or hyphens
    cpfValidation("29018170097"); // false
    cpfValidation("12312345600"); // false
     
    // With points or hyphens
    cpfValidation("123.123.456-00"); // false

    CNPJ

    import { cnpjValidation } from "biobe-validators";
     
    // No points or hyphens
    cnpjValidation("54334068000136"); // true
    cnpjValidation("00111222000100"); // false
     
    // With points or hyphens
    cnpjValidation("54.334.068/0001-36"); // true

    How to use with ES5

    const validator = require("biobe-validators");
     
    // No points or hyphens
    validator.cnpjValidation("54334068000136"); // true
    validator.cnpjValidation("00111222000100"); // false
    validator.cpfValidation("29018170097"); // true
    validator.cpfValidation("12312345600"); // false
     
    // With points or hyphens
    validator.cnpjValidation("54.334.068/0001-36"); // true
    validator.cpfValidation("123.123.456-00"); // false

    Install

    npm i biobe-validators

    DownloadsWeekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    7.43 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar