Package Exports
- nic-info
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 (nic-info) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
nic-info
A simple module to get information such as gender and birthday by providing Sri Lanka National Identity Card. This module does support new NIC Number format which was issues from 1st of January 2016.
Installation
npm install nic-info
// OR
yarn nic-infoUsage
var nicInfo = require('nic-info').nicInfo;
var useData = nicInfo('853409999V');which should return an object like below:
{
gender: {
type: 'M',
label: 'Male'
},
birthday: {
year: 1985,
month: 11, // 0 based
date: 5,
momentjsObj: moment("1985-12-05T00:00:00.000")
}
}Tests
yarn testThis will lint your code first then it will run unit tests
Other useful commands
yarn lint- lint your codeyarn lintfix- lint your code and fix common issuesyarn testonly- run test casestest-watch- run test cases in watch mode
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Bugs
If you find any please raise an Issue. Pull requests are welcome.
Release History
- 0.1.0 Initial release
License
MIT