national-id
v7.1.0
Published
Helper utility for national ids. Validation etc..
Downloads
2,112
Readme
NationalId 🆔
A library for validating national identity numbers for both people and organizations.
Supported countries 🌐
- norwegian
- danish
- swedish
- finnish
Install 📦
Yarn
yarn add national-idNpm
npm i national-idUsage 🚀
import { Norwegian } from 'national-id'
// usage through static implementation
Norwegian.person.isValid('01065100394')
...import { Danish } from 'national-id'
// usage through static implementation
Danish.person.isValid('0811115676')
...import { Swedish } from 'national-id'
// usage through static implementation
Swedish.person.isValid('0811115676')
...import { Finnish } from 'national-id'
// usage through static implementation
Finnish.person.isValid('0811115676')
...How to contribute 🤝
Everyone is allowed to contribute, but please raise an issue discussing what you want to do if it is anything major. Make sure to run tests and build commands if changing functionality. Write new tests if adding functionality.
All countries should have similar functions exposed, as defined by the Nation interface
