mlezcano1985 / rut

Format and validate rut (Chile) number between 2 and 10 digits for browser and NodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RUT FORMATTER

GitHub GitHub release (latest by date including pre-releases) GitHub Workflow Status

Format and validate rut (Chile) number between 2 and 10 digits for browser and NodeJS.

How to install?

npm install --save @mlezcano1985/rut-formatter

Example

On example folder, you find out Web and NodeJS examples. Install dependencies using: npm install.

Web

After install dependencies, run using a web server.

NodeJS

If you are test on NodeJS, you can run NodeJS example using this task: npm start.

How to use in NodeJS?

const rut = require('@mlezcano1985/rut-formatter');
const value = "111111";
console.log(rut.format(value));

Terminal should show 11.111-1. Valid rut.

const rut = require('@mlezcano1985/rut-formatter');
const value = "1";
console.log(rut.format(value));

Terminal should show null. Invalid rut.

Support

If you are having general issues with this package, feel free to contact me on Twitter.

If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request.

If you're using this package, I'd love to hear your thoughts. Thanks!

About

Format and validate rut (Chile) number between 2 and 10 digits for browser and NodeJS

License:MIT License


Languages

Language:JavaScript 89.7%Language:HTML 10.3%