npm

Need private packages and team management tools?Check out npm Orgs. »

nic-info

0.0.7 • Public • Published

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. 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.1.0 Initial release

License

MIT

install

npm i nic-info

Downloadsweekly downloads

1

version

0.0.7

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability