npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

zipcode-ja

v0.0.7

Published

zipcodes of japanpost.jp as static properties

Downloads

1,530

Readme

zipcode-ja

日本郵便 令和元年6月28日更新 郵便番号データ NodeJS / ブラウザ用 JavaScript

インストール

NodeJS

npm install zipcode-ja --save
import zipcodeJa from 'zipcode-ja';
console.log(zipcodeJa.version, zipcodeJa.lastModified); // '0.0.0', '2016-05-31'

ブラウザDownload Latest

<script src="zipcode-ja/lib/zipcode-ja.js"></script>
<script>
console.log(zipcodeJa.version, zipcodeJa.lastModified); // '0.0.0', '2016-05-31'
</script>

デモページ

使用方法

zipcodeJaは、一つの巨大なオブジェクトです。実在する郵便番号をキーとして与えると、対応する住所を返します。

console.log(zipcodeJa['1000002']);
// {
//   zipcode: '1000002',
//   zipcodeOld: '100',
//   jisX0402: '13101',
//   address: [
//     '東京都',
//     '千代田区',
//     '皇居外苑'
//   ],
//   ruby: [
//     'とうきょうと',
//     'ちよだく',
//     'こうきょがいえん'
//   ],
//   status: [
//     0,
//     0,
//     0,
//     0,
//     0,
//     0
//   ]
// }

それぞれのプロパティは、元データである郵便番号データの説明に対応しています。

  • zipcode郵便番号(7桁)
  • zipcodeOld(旧)郵便番号(5桁)
  • jisX0402全国地方公共団体コード(JIS X0401、X0402)
  • address都道府県名/漢字, 市区町村名/漢字, 町域名/漢字
  • ruby都道府県名/半角カタカナ, 市区町村名/半角カタカナ, 町域名/半角カタカナ
  • status 0. 一町域が二以上の郵便番号で表される場合の表示
    1. 小字毎に番地が起番されている町域の表示
    2. 丁目を有する町域の場合の表示
    3. 一つの郵便番号で二以上の町域を表す場合の表示
    4. 更新の表示
    5. 変更理由

注意事項として

  • address町域名が「以下に掲載がない場合」を「」に置換
  • rubyは半角カタカナではなく、全角ひらがなに置換

これは、他のスクリプトから利用する際の手順を省略するための調整です。

他のライブラリとの差異

開発環境

下記がグローバルインストールされていることが前提です。

  • NodeJS v6.2.1
  • Npm v3.9.3 (or pnpm)
git clone https://github.com/59naga/zipcode-ja
cd zipcode-ja
npm install

npm test

License

MIT