Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

egyptian-nationalid

Shuruhatik37BSD-2-Clause1.0.0TypeScript support: included

Egyptian national identity checker and data extraction from the Egyptian national identity

egyptian, egyptian national id, national id, id, egyptian-nationalid, رقم القومي, رقم القومي مصر, رقم القومي المصري, رقم قومي

readme

Egyptian national identity NPM version

Egyptian national identity checker and data extraction from the Egyptian national identity

Installing

Install with npm / yarn / pnpm / bun:

npm install egyptian-nationalid
yarn add egyptian-nationalid
pnpm add egyptian-nationalid
bun install egyptian-nationalid

Usage

Using Node.js require()

const { getInformation, isValid } = require('egyptian-nationalid');

TypeScript/ES Module support

import { getInformation, isValid } from 'egyptian-nationalid';

Deno

import { getInformation, isValid } from 'https://esm.sh/egyptian-nationalid';

Example

/*
    To get information from the Egyptian national id
*/
console.log(getInformation("27510120200771"))//To get the Egyptian national id information in English by default
console.log(getInformation("28309102300111",  "arabic"))//To get the Egyptian national id information in Arabic 

/*
    To check whether this is a valid national id or not
*/
console.log(isValid("28309102300111"))// If it is valid it will return true
console.log(isValid("83091024300111"))// If it is not valid, it will return false

getInformation data

English:

{
  type: 'Male',
  century: '19',
  age: 47,
  national_id: '27510120200771',
  birthday: {
    text: '1975/10/12',
    date: 1918-03-28T22:00:00.000Z,
    day: '12',
    month: '10',
    year: '1975'
  },
  governorate: 'Alexandria'
}

Arabic:

{
  type: 'ذكر',
  century: '19',
  age: 47,
  national_id: '27510120200771',
  birthday: {
    text: '1975/10/12',
    date: 1918-03-28T22:00:00.000Z,
    day: '12',
    month: '10',
    year: '1975'
  },
  governorate: 'الإسكندرية'
}

For more details about how the package works you can click here to see how the package works

If you have a problem or have a suggestion

License

Refer to the LICENSE file.