0.3.0 • Published 2 months ago

jp-zipcode-lookup v0.3.0

Weekly downloads
16
License
MIT
Repository
github
Last release
2 months ago

Japan Postal Zip Code Lookup

Node.js CI npm version

Synopsis

Oaza

const {Oaza} = require("jp-zipcode-lookup");

const oaza = Oaza.byZipcode("1040061")[0];

console.warn(oaza.pref.code, oaza.pref.name); // => 13 東京都
console.warn(oaza.city.code, oaza.city.name); // => 13102 中央区
console.warn(oaza.code, oaza.name); // => 1040061 銀座

City

const {City} = require("jp-zipcode-lookup");

const city = City.byCode("13103");

console.warn(city.code, city.pref.name, city.name); // => 13103 東京都 港区

const cities = City.byPref("13");

console.warn(cities.map(city => city.name).join(", ")); // => 千代田区, 中央区, 港区, ...

Pref

const {Pref} = require("jp-zipcode-lookup");

const pref = Pref.byCode("13");

console.warn(pref.code, pref.name); // => 13 東京都

TypeScript

import {City, Oaza, Pref} from "jp-zipcode-lookup";

const pref = Pref.byCode("13")!;
console.warn(pref.code, pref.name); // => 13 東京都

const city = City.byCode("13103")!;
console.warn(city.code, city.pref.name, city.name); // => 13103 東京都 港区

const oaza = Oaza.byZipcode("1040061")[0]!;
console.warn(oaza.code, oaza.name); // => 1040061 銀座

GitHub

See Also

The MIT License (MIT)

Copyright (c) 2018-2023 Yusuke Kawasaki

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.3.0

2 months ago

0.2.7

7 months ago

0.2.8

7 months ago

0.2.6

7 months ago

0.2.5

1 year ago

0.2.4

2 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

5 years ago