@aprestmo/norway-geodata 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -56,7 +56,7 @@ console.log(`Found ${municipalities.length} municipalities`);
56
56
 
57
57
  // Find Oslo
58
58
  const oslo = getMunicipalityById('0301');
59
- console.log('Oslo population:', oslo?.k_population);
59
+ console.log('Oslo population:', oslo?.population);
60
60
 
61
61
  // Search municipalities
62
62
  const bergMunicipalities = getMunicipalitiesByName('berg');
@@ -69,7 +69,7 @@ console.log(`Found ${postalCodes.length} postal codes`);
69
69
  // Get postal codes with details
70
70
  const detailedCodes = getAllPostalCodes(true);
71
71
  console.log('First postal code:', detailedCodes[0]);
72
- // Output: { zip: "0001", place: "Oslo", municipalityId: "0301", municipalityName: "Oslo" }
72
+ // Output: { code: "0001", place: "Oslo", municipalityId: "0301", municipalityName: "Oslo" }
73
73
 
74
74
  // Get all counties
75
75
  const counties = getCounties();
@@ -96,7 +96,7 @@ console.log(`Total postal codes: ${allPostalCodes.length}`);
96
96
  // Find a specific postal code
97
97
  const osloCenter = getPostalCodeByCode('0001');
98
98
  console.log(osloCenter);
99
- // Output: { k_postal_code: "0001", k_postal_place: "Oslo", k_id: "0301" }
99
+ // Output: { code: "0001", place: "Oslo", id: "0301" }
100
100
 
101
101
  // Search by place name (case-insensitive partial match)
102
102
  const bergensPostalCodes = getPostalCodesByPlace('bergen');
@@ -197,9 +197,9 @@ import type {
197
197
  const oslo: Municipality | undefined = getMunicipalityById('0301');
198
198
  if (oslo) {
199
199
  // Full IntelliSense support
200
- console.log(oslo.k_name); // string
201
- console.log(oslo.k_population); // number
202
- console.log(oslo.k_postal_codes); // readonly number[]
200
+ console.log(oslo.name); // string
201
+ console.log(oslo.population); // number
202
+ console.log(oslo.postal_codes); // readonly number[]
203
203
  }
204
204
  ```
205
205
 
@@ -208,33 +208,33 @@ if (oslo) {
208
208
  ### Municipality
209
209
  ```typescript
210
210
  interface Municipality {
211
- readonly k_id: string; // "0301" (Oslo)
212
- readonly k_name: string; // "Oslo"
213
- readonly k_name_no: string; // "Oslo"
214
- readonly k_adm_center: string; // "Oslo"
215
- readonly k_population: number; // 709037
216
- readonly k_area: number; // 454.07
217
- readonly k_language: LanguageStatus; // "Nøytral"
218
- readonly k_url: string; // "https://oslo.kommune.no"
219
- readonly k_postal_codes: readonly number[]; // [179, 180, 181, ...]
211
+ readonly id: string; // "0301" (Oslo)
212
+ readonly name: string; // "Oslo"
213
+ readonly name_no: string; // "Oslo"
214
+ readonly adm_center: string; // "Oslo"
215
+ readonly population: number; // 709037
216
+ readonly area: number; // 454.07
217
+ readonly language: LanguageStatus; // "Nøytral"
218
+ readonly url: string; // "https://oslo.kommune.no"
219
+ readonly postal_codes: readonly number[]; // [179, 180, 181, ...]
220
220
  }
221
221
  ```
222
222
 
223
223
  ### County
224
224
  ```typescript
225
225
  interface County {
226
- readonly f_id: string; // "03" (Oslo)
227
- readonly f_name: string; // "Oslo"
228
- readonly f_url: string; // "https://oslo.fylkeskommune.no"
226
+ readonly id: string; // "03" (Oslo)
227
+ readonly name: string; // "Oslo"
228
+ readonly url: string; // "https://oslo.fylkeskommune.no"
229
229
  }
230
230
  ```
231
231
 
232
232
  ### PostalCode
233
233
  ```typescript
234
234
  interface PostalCode {
235
- readonly k_postal_code: string; // "0001"
236
- readonly k_postal_place: string; // "Oslo"
237
- readonly k_id: string; // "0301" (municipality ID)
235
+ readonly code: string; // "0001"
236
+ readonly place: string; // "Oslo"
237
+ readonly id: string; // "0301" (municipality ID)
238
238
  }
239
239
  ```
240
240
 
@@ -0,0 +1,77 @@
1
+ [
2
+ {
3
+ "id": "03",
4
+ "name": "Oslo",
5
+ "url": "www.oslo.kommune.no"
6
+ },
7
+ {
8
+ "id": "11",
9
+ "name": "Rogaland",
10
+ "url": "www.rogfk.no"
11
+ },
12
+ {
13
+ "id": "15",
14
+ "name": "Møre og Romsdal",
15
+ "url": "www.mrfylke.no"
16
+ },
17
+ {
18
+ "id": "18",
19
+ "name": "Nordland",
20
+ "url": "www.nfk.no"
21
+ },
22
+ {
23
+ "id": "31",
24
+ "name": "Østfold",
25
+ "url": "www.ofk.no"
26
+ },
27
+ {
28
+ "id": "32",
29
+ "name": "Akershus",
30
+ "url": "www.afk.no"
31
+ },
32
+ {
33
+ "id": "33",
34
+ "name": "Buskerud",
35
+ "url": "www.bfk.no"
36
+ },
37
+ {
38
+ "id": "34",
39
+ "name": "Innlandet",
40
+ "url": "www.innlandetfylke.no"
41
+ },
42
+ {
43
+ "id": "39",
44
+ "name": "Vestfold",
45
+ "url": "www.vestfoldfylke.no"
46
+ },
47
+ {
48
+ "id": "40",
49
+ "name": "Telemark",
50
+ "url": "www.telemarkfylke.no"
51
+ },
52
+ {
53
+ "id": "42",
54
+ "name": "Agder",
55
+ "url": "www.agderfk.no"
56
+ },
57
+ {
58
+ "id": "46",
59
+ "name": "Vestland",
60
+ "url": "www.vestlandfylke.no"
61
+ },
62
+ {
63
+ "id": "50",
64
+ "name": "Trøndelag",
65
+ "url": "www.trondelagfylke.no"
66
+ },
67
+ {
68
+ "id": "55",
69
+ "name": "Troms",
70
+ "url": "www.tromsfylke.no"
71
+ },
72
+ {
73
+ "id": "56",
74
+ "name": "Finnmark",
75
+ "url": "www.ffk.no"
76
+ }
77
+ ]