JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 144
  • Score
    100M100P100Q82071F
  • License MIT

Generator/validator for (Dutch) BSNs

Package Exports

  • bsn-js
  • bsn-js/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bsn-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

lint-test-build pages-build-deployment

bsn-js

bsn-js can be used to generate a test BSN (burger service nummer) or validate an existing BSN

installation

npm install bsn-js

or using yarn

yarn add bsn-js


usage

validate existing BSN

import { isValidBSN } from 'bsn-js'

or

const { isValidBSN } = require('bsn-js')

pass the BSN (string) to the function and it will return true or false

example: const validBSN = isValidBSN('12312312') # false


generate BSN for testing

import { generateBSN } from 'bsn-js'

or

const { generateBSN } = require('bsn-js)

test BSNs will consist of 9 characters

the Dutch authority has reserved BSNs starting with 0000 and 99999 for testing

the generetated BSN will start with 99999 by default

const bsn = generateBSN() # 999999400

when the function generateBSN is given true as argument, it will return a BSN starting with 0000

const bsn = generateBSN(true) # 000078840


information BSN

offical docs

11 check