danish-mock-cpr

1.1.4 • Public • Published

danish-mock-cpr


automationpi :)

You may need to test with random Danish CPR numbers in your automation test scenarios. This package helps by generating CPR numbers for test.


Getting started

npm install danish-mock-cpr

Example.

const cpr = require('danish-mock-cpr');

console.log(cpr.generateCPR()) // default
console.log(cpr.generateCPR(2012)) // Generate a CPR for a person born between 2012 and today
console.log(cpr.generateCPR(1980,2000)) // Generate a CPR for a person born between 1980 and 2000
console.log(cpr.generateCPR('','','male')) // Gender male
console.log(cpr.generateCPR('','','Female')) // Gender female
console.log(cpr.generateCPR('1980', '1990', 'Female')) // born between a start date and end date, gender female
console.log(cpr.generateCPR('2001','2015','Male')) // born between a start date and end date, gender male

#Ouput

>node app.js

{ cpr: '0303117289' }
{ cpr: '2112155744' }
{ cpr: '1507967828' }
{ cpr: '0101009143' }
{ cpr: '0101006446' }

#reusenotreinvent

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i danish-mock-cpr

      Weekly Downloads

      56

      Version

      1.1.4

      License

      MIT

      Unpacked Size

      4.88 kB

      Total Files

      7

      Last publish

      Collaborators

      • mexl