Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ec-docs-validator

ferguevara200027MIT1.0.5TypeScript support: included

Validador de los datos de documentos mas utilizados en Ecuador.

ecuador, cedula, validador, validator, cedula, ruc, codigo postal, placas, telefono, celular, dni

readme

ECUADOR VALIDATOR DOCUMENTS

Validator for Ecuadorian Identification Documents
Validator para las identificaciones de los principales documentos usados en Ecuador: Cédula, ruc, teléfono fijo, teléfono celular, placas de vehiculos y motos, codigo postal y más datos.

Installation

To install this package, use npm:

npm install ec-docs-validator

Getting Started

Importing the Library

Javascript:

const validator = require('ec-docs-validator')

Typescript:

import validator from 'ec-docs-validator'

Usage

validator.ci(ci);
validator.ruc(ruc);
validator.cellphone(cellphone);
validator.telephone(telephone);
validator.plates(plate);
validator.zipCode(zipCode);

And you can use it like this:

validator.ci('1710034065'); // true
validator.ci('1234567890'); // false
validator.ruc('1804384731001'); // true
validator.ruc('1234567890123'); // false
validator.cellphone('0983484667'); // true
validator.cellphone('0884784667'); // false
validator.telephone('022895741'); // true
validator.telephone('022895741'); // true
validator.plates('PBA0389'); // true
validator.plates('IS150D'); // true
validator.plates('PBA038'); // false
validator.zipCode('128456'); // true
validator.zipCode('21456'); // false

Testing

To run the tests, use the following command:

npm test

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author - Contact

Fernando Guevara Bayas - Website