Skip to content
A simple module to get information such as gender and birthday by providing Sri Lanka National Identity Card.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
src
.babelrc
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
yarn.lock

README.md

nic-info Build Status npm version

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 add nic-info

Usage

    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 test

This will lint your code first then it will run unit tests

Other useful commands

  1. yarn lint - lint your code
  2. yarn lintfix - lint your code and fix common issues
  3. yarn testonly - run test cases
  4. yarn test-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.0.1 Initial release
  • 0.0.7 Stable release

License

MIT

You can’t perform that action at this time.