This is a JavaScript library that provides utility functions to do validations of Argentinian's document numbers, identification numbers and phones.
- Install nodejs (https://nodejs.org/en/download/).
- Run
npm install --save arg.js
.
// CBUs identify a bank account
var cbu = require('arg.js').cbu;
var valid = cbu.isValid('123'); // false
// CUITs identify a person or a company
var cuit = require('arg.js').cuit;
var valid = cuit.isValid('27361705039'); //true
// DNIs identify a person (including a foreigner living in Argentina)
var doc = require('arg.js').document;
var validDni = doc.isValidDni('36111222'); //true
// Phones will be returned with the country and area code
var phones = require('arg.js').phone;
var cleanPhone = phones.clean('1556623011', '11'); //+5491156623011
PRs are welcome!
- To run the tests run
npm test
. - To build the documentation run
gulp doc
. - To view the documentation go to
docs/gen/index.html
.