JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q35235F
  • License MIT

A simple module to get information such as gender and birthday by providing Sri Lanka National Identity Card

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-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