Skip to content

Commit

Permalink
Updated README with more info.
Browse files Browse the repository at this point in the history
Added JSDoc to exported functionality.
  • Loading branch information
Ondkloss committed May 10, 2019
1 parent 01c8dde commit 46adc9d
Show file tree
Hide file tree
Showing 5 changed files with 255 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
node_modules
dist
out
*.js
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Norwegian numbers

[![Build Status](https://travis-ci.com/Ondkloss/norwegian-numbers.js.svg?branch=master)](https://travis-ci.com/Ondkloss/norwegian-numbers.js)
![npm](https://img.shields.io/npm/v/norwegian-numbers.svg) [![Build Status](https://travis-ci.com/Ondkloss/norwegian-numbers.js.svg?branch=master)](https://travis-ci.com/Ondkloss/norwegian-numbers.js)

Make and verify official Norwegian numbers:

* KID-nummer: `makeKidNumber` and `verifyKidNumber`
* Organisasjonsnummer: `makeOrganisationNumber` and `verifyOrganisationNumber`
* Fødselsnummer: `makeBirthNumber` and `verifyBirthNumber`
* Kontonummer: `makeAccountNumber` and `verifyAccountNumber`
* KID-nummer: `makeKidNumber(value, mode = 'MOD10')` and `verifyKidNumber(value, mode = 'MOD10')`
* Organisasjonsnummer: `makeOrganisationNumber(value)` and `verifyOrganisationNumber(value)`
* Fødselsnummer: `makeBirthNumber(value)` and `verifyBirthNumber(value)`
* Kontonummer: `makeAccountNumber(value)` and `verifyAccountNumber(value)`

This currently only concerns itself with the control digits.

Expand All @@ -23,8 +23,25 @@ Example code usages after installation:

> const nn = require('norwegian-numbers');
undefined
> kid.makeKidNumber('1234');
> nn
{ makeKidNumber: [Function: makeKidNumber],
verifyKidNumber: [Function: verifyKidNumber],
makeBirthNumber: [Function: makeBirthNumber],
verifyBirthNumber: [Function: verifyBirthNumber],
makeAccountNumber: [Function: makeAccountNumber],
verifyAccountNumber: [Function: verifyAccountNumber],
makeOrganisationNumber: [Function: makeOrganisationNumber],
verifyOrganisationNumber: [Function: verifyOrganisationNumber] }
> nn.makeKidNumber('1234');
'12344'
> nn.makeKidNumber('1234', 'MOD11');
'12343'
> nn.makeBirthNumber('311299567');
'31129956715'
> nn.makeAccountNumber('1234567890');
'12345678903'
> nn.makeOrganisationNumber('12345678');
'123456785'

## Testing from source

Expand All @@ -42,6 +59,12 @@ The distribution was created by the following commands:

npm publish --access public

## Changes

### 1.0.6

* Added JSDoc

## Notes

Mainly made as a TypeScript NPM package test bed. Check out these packages:
Expand Down
162 changes: 161 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "norwegian-numbers",
"version": "1.0.5",
"version": "1.0.6",
"description": "Make and verify official Norwegian numbers like: KID-nummer, organisasjonsnummer, fødselsnummer, kontonummer.",
"main": "dist/norwegian-numbers.js",
"scripts": {
"build": "tsc",
"test": "mocha -r ts-node/register test/*"
"test": "mocha -r ts-node/register test/*",
"doc": "jsdoc dist README.md"
},
"repository": {
"type": "git",
Expand All @@ -27,6 +28,7 @@
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.6",
"chai": "^4.2.0",
"jsdoc": "^3.6.1",
"mocha": "^6.1.4",
"ts-node": "^8.1.0",
"typescript": "^3.4.5"
Expand Down
Loading

0 comments on commit 46adc9d

Please sign in to comment.