ein-validator
Validate and mask a U.S. Employer Identification Number (EIN).
Status
Installation
Install the package via npm
:
npm install ein-validator --save
Usage
isValid(value)
This method validates if the given value is a valid Employer Identification Number
.
Arguments
value
(*): The value to validate.
Returns
(boolean): Returns whether the input value is a valid EIN or not.
Example
isValid({});
isValid('0112345-67');
isValid('01-1234567');
isValid('011234567');
mask(value)
This method will help you protect this sensitive piece of information by obfuscating some digits.
Arguments
value
(*): The value to mask.
Returns
(string): Returns the masked value by replacing value certain digits by 'X'.
Example
mask({});
mask('0112345-67');
mask('01-1234567');
mask('011234567');
Tests
To test using a local installation of node.js
:
npm test
To test using Docker exclusively:
docker-compose run --rm sut
Release
npm version [<newversion> | major | minor | patch] -m "Release %s"
License
MIT