spain-id

1.1.7 • Public • Published

spain-id

What is this?

A very small library to validate spanish id documents (NIF, CIF, NIE).

From version 1.1.0 there is TypeScript support.

Installation

npm i spain-id

Or with yarn

yarn add spain-id

Usage

// import just what you need
import { validateSpanishId, spainIdType, validDNI, validNIE, validCIF } from 'spain-id'

validateSpanishId('39740191D') // Validates the 3 types of document
spainIdType('39740191D') // 'dni'
validDNI('14741806W') // true
validNIE('X8095495R') // true
validCIF('P4622000J') // true

Build and publish

Run npm publish.

Credits

Note: Based on these algorithms

CIF validation has been fixed, added TypeScript support, and code style changed.

Readme

Keywords

Package Sidebar

Install

npm i spain-id

Weekly Downloads

1,729

Version

1.1.7

License

MIT

Unpacked Size

8.82 kB

Total Files

6

Last publish

Collaborators

  • monjo