rut-formatter

1.0.1 • Public • Published

Introduction

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

Getting Started

  1. Download or clone project
  2. Install dependencies: npm install (optional if you want to run web example).

Example

On example folder, you find out Web and NodeJS examples.

Web

After install dependencies, run task: npm run start-web.

NodeJS

IF you are test on NodeJS, you can run NodeJS example using this task: npm run start-nodejs

How to use in NodeJS?

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

Terminal should show 11.111-1. Valid rut.

const rut = require('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!

Package Sidebar

Install

npm i rut-formatter

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.04 kB

Total Files

8

Last publish

Collaborators

  • mlezcano1985