rut-verifier
TypeScript icon, indicating that this package has built-in type declarations

3.1.4 • Public • Published

rut-verifier

Greenkeeper badge npm version Build Status

Synopsis

This module will help you verify chilean RUTs (Rol Único Tributario).

Breaking Changes in 3.0.0

-Now using promises instead of callbacks

Breaking Changes in 2.0.0

-Function callback is now in a standard format (error first callback).

Code Example

Sample usage:

V3+
var rutVerifier = require('rut-verifier')

rutVerifier.verify('198765430')
  .then(isValid=>console.log(isValid?'VALID RUT':'INVALID RUT')
  .catch(console.error)


rutVerifier.getDigit(19876543)
.then(digit=>console.log(digit)) //0
.catch(console.error)




V2
var rutVerifier = require('rut-verifier')

rutVerifier.verify('198765430', function (err, isValid) {
  if (err) {
    return console.error(err)
  }
  if (isValid) {
    console.log('VALID RUT')
  } else {
    console.log('INVALID RUT')
  }
})

rutVerifier.getDigit(19876543, function(err, digit){
  if(err){
    return console.error(err)
  }
  console.log(digit) //0
})

Installation

Install the dependency

npm install rut-verifier --save

Tests

Mocha and Chai are used for testing. To run the tests:

npm test

Connect with the author

Email me to flakolefluk@gmail.com

Contributors

If you want to contribute, open a new issue or fork the repository and add a pull request

License

Read LICENSE.md

Readme

Keywords

Package Sidebar

Install

npm i rut-verifier

Weekly Downloads

2

Version

3.1.4

License

MIT

Unpacked Size

9.8 kB

Total Files

5

Last publish

Collaborators

  • flakolefluk