Simple library to validate Iranian national code.
npm install national-codeSimple library to validate Iranian national code.
npm:
``sh`
npm install national-code --save
Yarn (note that yarn add automatically saves the package to the dependencies in package.json):`sh`
yarn add national-code
`js`
import nationalCode from 'natioanl-code';
nationalCode(4839941637); // => true
nationalCode(4839941638); // => false
nationalCode('4839941637'); // => true
nationalCode('4839941638'); // => false
nationalCode('2222222222'); // => false
nationalCode(3333333333); // => false
or:
`js`
var nationalCode = require('national-code');
nationalCode('4839941637'); // => true
1. git clone https://github.com/arashmanteghi/national-code.gitnpm install
2. Run npm start
3. Start the http-server using
3. Open http://localhost:9000
- npm start - start the http-servernpm run build
- - build as productionnpm run lint
- - run an ESLint checknpm run coverage
- - run code coverage and generate report in the coverage foldernpm test
- - run all testsnpm run test:watch` - run all tests in watch mode
-