# mrz-gen

> MRZ code generator

Latest version **1.0.8** (published 2019-03-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install mrz-gen
pnpm add mrz-gen
yarn add mrz-gen
bun add mrz-gen
```

Provides the command `mrz-gen`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2019-03-31 |
| First published | 2019-03-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 46.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | lubansachin70 |
| Maintainers | lubanasachin70 |
| Keywords | mrz, tsc, nodejs, javascript |

## Links

- npm: https://www.npmjs.com/package/mrz-gen
- npm.io page: https://npm.io/package/mrz-gen

## Dependencies (1)

- [moment](https://npm.io/package/moment.md) ^2.24.0

## Recent versions

- 1.0.8 (latest) — 2019-03-31
- 1.0.7 — 2019-03-31
- 1.0.6 — 2019-03-31
- 1.0.5 — 2019-03-31
- 1.0.4 — 2019-03-31
- 1.0.3 — 2019-03-31
- 1.0.2 — 2019-03-31
- 1.0.1 — 2019-03-31
- 1.0.0 — 2019-03-31

## README

# Machine-readable zone code generator

This library helps to generate [Machine-readable zone codes](https://en.wikipedia.org/wiki/Machine-readable_passport). 
It's implemented with Node.js and TypeScript. 

## Dependencies:

The project depends on the following dev libraries:
* `Node.js`;
* `TypeScript`;
* `jest` and `ts-jest`;
* `ts-node-dev`;
* `tslint`.


## Installation

To install it as your project dependency, run:

```sh
$ npm install mrz-gen
```

## API

The library exports some methods:
* `generate` – the function that actually generates the code. It validates the data and generates the MRZ code.;
  

### Basic example

You could use `generate` function to generate a machine-readable zone code. 

```typescript
import { generate } from 'mrz-gen';

const code = generate({
  user: {
    firstName: 'Jane',
    lastName: 'Lodges',
    passportNumber: '123456789',
    countryCode: 'USA',
    nationality: 'USA',
    birthday: '01.02.1983',
    gender: 'F',
    validUntilDay: '02.03.2028',
    personalNumber: '12345678901234',
  },
});

// Prints P<USALODGES<<JANE<<<<<<<<<<<<<<<<<<<<<<<<<<<\n1234567897USA8302010F28030211234567890123454
console.log(code);
```

## Copyright

Author: Sachin Lubana ([@lubanasachin](https://github.com/lubanasachin))

---
_Source: https://npm.io/package/mrz-gen · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
