1.0.3 ā€¢ Published 4 years ago

validate-rut-serie v1.0.3

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Validate rut

Tool for validate rut with document number in Chile

Starting šŸš€

How to install šŸ“‹

First install with npm

npm i validate-rut-serie

Or yarn

yarn add validate-rut-serie

Using the tool āš™ļø

First import the tool, then call the async method isValid, sending an object with rut and serie (without points), it will return an boolean

Example šŸ”©

const { isValid } = require("validate-rut-serie")

async function tellIfIsValid() {
    const valid = await isValid({rut:"11.111.111-1", serie:"123456789"})
    console.log(valid) // return true if is valid, or false if is invalid
}

tellIfIsValid()

Valid formats for serie

The only format is 9 numbers of the number document, without points, string format

Valid formats for rut āŒØļø

// valids
('18.972.631-7')
('18972631-7')
('189726317')
('9.068.826-k')
('9068826-k')
('9068826k')

// invalids
('18.972.631-0')
('18,972,631-7')
('18*972*631-7')
('18-972-631-7')
('error18.972.631-7')
('9068826-1')
('')
(189726317)
('0')
(0)

Building with: šŸ› ļø

  • rut.js - Tool for validate RUT
  • axios - To request if the rut is valid (to chilean servers)

Authors āœ’ļø

  • Christian Rodriguez - Inforser - crod

Licence šŸ“„

MIT

Thanks šŸŽ

  • Thanks for read this readme! šŸ“¢

āŒØļø with ā¤ļø for crod-inforser šŸ˜Š