tax-id-validator

1.0.3 • Public • Published

Tax Id Validator

This library validates tax identification numbers.

How to use

First you neeed to install the package via npm:

npm install --save tax-id-validator
var taxValidator = require('tax-id-validator');
// validate has the follwing signature:
// validate(taxId, doNotValidate2015, doNotValidate2016), only taxId is required
var isValid = taxValidator.validate('44567139207');

The validate-method accepts only strings;

You can further specify wich versions of valid tax-ids you want to test, because since 2016, another set of tax-ids is valid. You can use the optional parameters to test for a specific version of the tax-id.

// only validate pre 2016-ids
var isValid = taxValidator.validate('44567139207', false, true);
// only validate post 2016-ids
var isValid = taxValidator.validate('12345679998', true, false);

Package Sidebar

Install

npm i tax-id-validator

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

10.1 kB

Total Files

5

Last publish

Collaborators

  • mbayraktr