New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-mrz-parser

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mrz-parser

Validate & Parse Identity and Passport

  • 1.0.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

node-mrz-parser

Verify & Parse Identity and Passport

List of Features

  • Verify Identity, Passport
  • Parse Identity, Passport

Download & Installation

$ npm i node-mrz-parser

Example Usage

Create "test.js" file

const {parseIdentity, parsePassport} = require('node-mrz-parser')

// Example Identity
const identity = [
  "I<TURA12Z345673<22345678902<<<",
  "7506121M2610047TUR<<<<<<<<<<<0",
  "SURNAME<<NAME<<<<<<<<<<<<<<<<<"
]

// Example Passport
const passport = [
  "P<TURSURNAME<<NAME<<<<<<<<<<<<<<<<<<<<<<<<<<",
  "U105619491TUR8607070M160216829089467870<<<82"
]

console.log("Identity")
console.log(parseIdentity(identity))
console.log("Passport")
console.log(parsePassport(passport))

Run Test File

$ node test.js

If information given is valid, then status will be true. Otherwise status will be false and you can see the error message in the response.

SUCCESS RESPONSE


Identity

{
  status: true,
  message: '',
  data: {
    doc_type: 'I',
    country_code: 'TUR',
    country: 'Turkey',
    document_no: 'A12Z34567',
    document_no_check: '3',
    identity: '22345678902',
    birth_date: '1975-06-12',
    birth_date_check: '1',
    sex: 'Male',
    expiry_date: '2026-10-04',
    expiry_date_check: '7',
    nationality: 'Turkish',
    overall_check: '0',
    name: 'NAME',
    middlename: '',
    surname: 'SURNAME'
  }
}

Passport

{
  status: true,
  message: '',
  data: {
    doc_type: 'P',
    country_code: 'TUR',
    country: 'Turkey',
    document_no: 'U10561949',
    document_no_check: '1',
    birth_date: '1986-07-07',
    birth_date_check: '0',
    sex: 'Male',
    expiry_date: '2016-02-16',
    expiry_date_check: '8',
    nationality: 'Turkish',
    overall_check: '2',
    name: 'NAME',
    middlename: '',
    surname: 'SURNAME',
    identity: '29089467870',
    personal_data_check: '8'
  }
}

ERROR RESPONSE


Identity

{ status: false, message: 'Invalid document no', data: null }

Passport

{ status: false, message: 'Invalid document no', data: null }

Keywords

FAQs

Package last updated on 30 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc