jp-city-lookup
TypeScript icon, indicating that this package has built-in type declarations

0.2.6 • Public • Published

Japan City Code Lookup

Node.js CI npm version

  • JIS X 0402: Identification code for cities, towns and villages
  • Reverse Geocoding: Japan Standard Grid Square (1km accuracy)
  • Standalone: No module dependencies

Synopsis

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

// lookup by pair of latitude and longitude
console.log(City.lookup({lat: 35.68944, lng: 139.69167})); // => ["13104", "13113"]

// lookup by comma separated latitude and longitude
console.log(City.lookup({ll: "35.1709,136.8815"})); // => ["23104", "23105"]

// lookup by JIS prefecture code
console.log(City.lookup({pref: "13"})); // => ["13101", "13102", ... "13421"]

// lookup by neighboring city code
console.log(City.lookup({neighboring: "13101"})); // => ["13102", "13104", ... "13106"]

// name for city code
console.log(City.name("13101")); // => "千代田区"

GitHub

Reference

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.

Readme

Keywords

Package Sidebar

Install

npm i jp-city-lookup

Weekly Downloads

6

Version

0.2.6

License

MIT

Unpacked Size

2.15 MB

Total Files

8

Last publish

Collaborators

  • kawanet