Package Exports
- national-code
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (national-code) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
National Code
Simple library to validate Iranian national code.
Install
npm:
npm install national-code --saveYarn (note that yarn add automatically saves the package to the dependencies in package.json):
yarn add national-codeUsage
import nationalCode from 'natioanl-code';
nationalCode(4839941637); // => true
nationalCode(4839941638); // => false
nationalCode('4839941637'); // => true
nationalCode('4839941638'); // => false
nationalCode('2222222222'); // => false
nationalCode(3333333333); // => falseor:
var nationalCode = require('national-code');
nationalCode('4839941637'); // => trueLunch demo as indepented project
git clone https://github.com/arashmanteghi/national-code.git- Run
npm install - Start the http-server using
npm start - Open http://localhost:9000
Commands
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 thecoveragefoldernpm test- run all testsnpm run test:watch- run all tests in watch mode
Licence
national-code is available under MIT.