@rsgarate/rut

0.1.3 • Public • Published

RutJS

Simple and small library of utilities to validate, generate and format the RUT. Works with CJS and ESM

Badges

npm version npm downloads Github Actions Codecov

Installation

Install package:

# npm
npm install @rsgarate/rut

# yarn
yarn install @rsgarate/rut

# pnpm
pnpm install @rsgarate/rut

Usage/Examples

//CJS
const {  clean, format, generate, getCheckDigit, isValid } = require('@rsgarate/rut')

//ESM
import {  clean, format, generate, getCheckDigit, isValid } from '@rsgarate/rut'


clean('16.155.435-9')   // '161554359'

format('161554359')    // '16.155.435-9'
format('161554359', {dashAlone: true})    // '16155435-9'

generate()    // 207377929

getCheckDigit('15255657')    // 8

isValid('161554359')    // true
isValid('161554358')    // false

Run Locally

  • Clone this repository
  • Install dependencies using pnpm install

Running Tests

To run tests, run the following command

  pnpm test

Authors

License

Published under MIT License.


Made with 💛

Readme

Keywords

Package Sidebar

Install

npm i @rsgarate/rut

Weekly Downloads

3

Version

0.1.3

License

MIT

Unpacked Size

7.93 kB

Total Files

5

Last publish

Collaborators

  • rsgarate