bsn-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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

works for JavaScript and TypeScript (type definitions included)

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

official docs

11 check

Package Sidebar

Install

npm i bsn-js

Weekly Downloads

20

Version

1.0.4

License

MIT

Unpacked Size

7.91 kB

Total Files

11

Last publish

Collaborators

  • wilmverb