Check if supplied input is valid fødselsnummer (Norwegian national identification number).
Identify if number is an F or D-number
From npm
$ npm i --save is-valid-fodselsnummer
From GitHub
$ git clone https://github.com/zrrrzzt/is-valid-fodselsnummer.git
cd into directory and install dependencies
$ npm run setup
const isValidFodselsnummer = require('is-valid-fodselsnummer')
isValidFodselsnummer('01010750160')
// => true
isValidFodselsnummer('12341234567')
// => false
const isValidFodselsnummer = require('is-valid-fodselsnummer')
isValidFodselsnummer('01010750160', true)
// => F
isValidFodselsnummer('41085801188', true)
// => D
isValidFodselsnummer('12341234567', true)
// => false
- is-valid-fodselsnummer-cli CLI version of this module