Skip to content

Sjekker om du skal ha transport med NSB på bakgrunn av skolevalg og bostedsadresse

License

Notifications You must be signed in to change notification settings

telemark-arkiv/tfk-saksbehandling-skoleskyss-nsb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status js-standard-style

tfk-saksbehandling-skoleskyss-nsb

Greenkeeper badge Node-module for identifying NSB as transporter.

It uses a combination of zipcodes and schoolids.

Installation

From npm

$ npm i tfk-saksbehandling-skoleskyss-nsb

From GitHub

$ git clone git@github.com:telemark/tfk-saksbehandling-skoleskyss-nsb.git

cd into the directory and run the setup script

$ npm run setup

This will install the module dependencies

Usage

Pass in an options object and get true or false in return.

postnummer zipcode, required

skole schoolid, required

'use strict';

const transportByNSB = require('tfk-saksbehandling-skoleskyss-nsb')
const drangedal = {
  postnummer: 3750,
  skoleid: 3802
}
const fyresdal = {
  postnummer: 3870,
  skoleid: 3802
}

console.log(transportByNSB(drangedal)) //=> true

console.log(transportByNSB(fyresdal)) //=> false

The logic is explained in the docs/postkoder.pr.vgs.skole.2016.xlsx file

The complete list of schoolids is in lib/data/skoler.json

Test

$ npm test

About

Sjekker om du skal ha transport med NSB på bakgrunn av skolevalg og bostedsadresse

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published