npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iasig/idnx-validator

v1.0.0

Published

JavaScript/TypeScript library for validating Moldova national IDs (IDNP, IDNO, IDNV)

Readme

Moldova National IDs - Validator

npm version CI/CD License: MIT

Overview

IDNX-Validator is a TypeScript/JavaScript library designed for validating different types of IDs from the Republic of Moldova's national registry. This library efficiently validates personal national IDs (validateIDNP), organisation IDs (validateIDNO), and vehicle IDs (validateIDNV), ensuring their compliance with specific format and checksum standards.

Features

  • TypeScript Support: Full TypeScript support with type definitions included
  • Personal National ID Validation (validateIDNP): Validates IDs assigned to individuals, ensuring they follow a specific 13-digit format and pass checksum verification
  • Organization ID Validation (validateIDNO): Checks organization IDs for format compliance and accuracy based on their unique 13-digit structure
  • Vehicle ID Validation (validateIDNV): Ensures vehicle IDs adhere to the prescribed 13-digit format and pass the checksum test
  • Zero Dependencies: Lightweight with no external dependencies
  • Comprehensive Tests: 100% test coverage

Installation

npm install @iasig/idnx-validator

Or using yarn:

yarn add @iasig/idnx-validator

Or using pnpm:

pnpm add @iasig/idnx-validator

Usage

JavaScript

const { validateIDNP, validateIDNO, validateIDNV } = require('@iasig/idnx-validator');

// Validate Personal National ID
const isValidIDNP = validateIDNP('2001234567897');
console.log(isValidIDNP); // true or false

// Validate Organization ID
const isValidIDNO = validateIDNO('1001234567896');
console.log(isValidIDNO); // true or false

// Validate Vehicle ID
const isValidIDNV = validateIDNV('3001234567898');
console.log(isValidIDNV); // true or false

TypeScript

import { validateIDNP, validateIDNO, validateIDNV } from '@iasig/idnx-validator';

// Validate Personal National ID
const isValidIDNP: boolean = validateIDNP('2001234567897');
console.log(isValidIDNP); // true or false

// Validate Organization ID
const isValidIDNO: boolean = validateIDNO('1001234567896');
console.log(isValidIDNO); // true or false

// Validate Vehicle ID
const isValidIDNV: boolean = validateIDNV('3001234567898');
console.log(isValidIDNV); // true or false

API

validateIDNP(value: string): boolean

Validates a Moldovan Personal National ID (IDNP).

  • Parameter: value - The IDNP to validate (13-digit string starting with 2 or 09)
  • Returns: true if the IDNP is valid, false otherwise

validateIDNO(value: string): boolean

Validates a Moldovan Organization ID (IDNO).

  • Parameter: value - The IDNO to validate (13-digit string starting with 1)
  • Returns: true if the IDNO is valid, false otherwise

validateIDNV(value: string): boolean

Validates a Moldovan Vehicle ID (IDNV).

  • Parameter: value - The IDNV to validate (13-digit string starting with 3)
  • Returns: true if the IDNV is valid, false otherwise

How It Works

The library employs regular expressions and a checksum calculation method to validate the IDs. It uses three different regular expressions, each tailored to a specific type of ID:

  • IDNP_REGEX: For personal national IDs (starts with 2 or 09)
  • IDNO_REGEX: For organization IDs (starts with 1)
  • IDNV_REGEX: For vehicle IDs (starts with 3)

The validation process involves:

  1. Checking the format using the appropriate regular expression
  2. Verifying the checksum, which is calculated based on the first 12 digits using the formula:
    • Each digit is multiplied by a weight (7, 3, or 1 in a repeating pattern)
    • The sum modulo 10 must equal the 13th digit

Development

Setup

npm install

Build

npm run build

Run Tests

npm test

Run Tests with Coverage

npm run test:coverage

License

IDNX-Validator is open-source and available under the MIT License.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Visit iasig.md to learn more about our products.