GitXplorerGitXplorer
s

kommunkoder

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
61020c8e8bdb548290586c85a2895c3a299c31bc

Update README.md

ssimon-johansson committed 10 years ago
Unverified
eb9be7fa0f478cf88879aec7736a80ff1360edd1

Add "Include" instructions to README

ssimon-johansson committed 10 years ago
Unverified
58448c4a411ca548fc9a4791508f101d1bb04ac3

Fix path to test file for zuul script

ssimon-johansson committed 10 years ago
Unverified
844f8beb9990dbeba2b55e277331348fe17c9169

Add SouceLabs badge to README

ssimon-johansson committed 10 years ago
Unverified
665b6a4d1f686dc6cd209522cf561bf959d4f3e6

Add zuul dependency to integreate with SouceLabs

ssimon-johansson committed 10 years ago
Unverified
fd777aca4a00e33c23d888bc4e645de234755a4b

Fix to satisfy jshint

ssimon-johansson committed 10 years ago

README

The README file for this repository.

kommunkoder

NPM version Build Status Coverage Status Dependency Status

Sauce Test Status

Collection of all municipalities in Sweden with corresponding county and municipality codes (kommunkoder)

Data is provided by SCB (Statistiska Centralbyrån). Lib is up-to-date as of 2015-07-03, no changes to either counties or municipalities will be made until 2016-01-01.

Install

####Client

$ bower install kommunkoder --save

####Node

$ npm install kommunkoder --save

##Include

####Client

<script src="bower_components/kommunkoder/kommunkoder.min.js"></script>

####Node

var kommunkoder = require('kommunkoder');

Usage

kommunkoder();
// → [ Array of all municipalities ]

kommunkoder(1440);
// → { code: '1440', municipality: 'Ale', county: 'Västra Götalands län' }

kommunkoder({municipality: "Falkenberg"});
// → { code: "1382", municipality: "Falkenberg", county: "Hallands län" }

kommunkoder({county: "Stockholms län"});
// → [ Array of all municipalities in specified county ]

// pass an array of searches to get an array of multiple results
kommunkoder(["1231", "1233", {municipality: "Skövde"}]);
// → [{ code: '1231', municipality: 'Burlöv', county: 'Skåne län' },
//    { code: '1233', municipality: 'Vellinge', county: 'Skåne län' },
//    { code: '1496', municipality: 'Skövde', county: 'Västra Götalands län' }]

// 'undefined' is retunred if no match is found
kommunkoder(666);
// → undefined

Tests

# clone this repo
$ npm install
$ npm test

License

MIT © Simon Johansson