A lightweight (zero-dependency) library for validating, formatting, and cleaning Chilean RUT (Rol Único Tributario). Current stable version: 1.0.1. It provides three primary functions: validateRut (returns boolean), formatRut (adds dots and dash, uppercase K), and cleanRut (removes separators). Ships TypeScript types. Unlike alternatives, it has a simple API with no dependencies and is focused only on Chilean RUT operations.
npm install rut-validator-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Validates, formats, and cleans a Chilean RUT. Shows three core functions: validate (boolean), format (with dots and dash), clean (remove separators).
Use cleanRut before formatRut if the input may contain dots or dash.
Always pass a string representation of the RUT, e.g., '11111111-1' or '111111111'.
Use dynamic import() or switch to ESM (type: 'module' in package.json or .mjs files).
None needed.
Add 'type': 'module' to your package.json or rename file to .mjs.
Change import to: import { validateRut } from 'rut-validator-formatter'Convert number to string: validateRut(String(rut))
Run: npm install rut-validator-formatter
Delete node_modules and package-lock.json, then reinstall.
No dependency data recorded yet.