jp-postal

    3.0.0 • Public • Published

    Japanese postal data from official database

    There are instructions to download, rebuild and obtain the latest data from official source

    Latest database update: July 1, 2020

    更新日:2020年7月1日

    Data source and explanation

    Usage

    • Directly download and use postal.json
    • Or install module jp-postal via npm install --save jp-postal or yarn add jp-postal
    • Default export (postal.json) maps 7 digits postal code (string format) into a map whose key is prefecture name and value is array of regions under the prefecture
    • Some regions have same postal code. For example: postal code 4520961 is associated with 66 regions, 2 regions in different prefectures have same postal code 4980000 (July 1, 2020)
    • Usage example:
    const postal = require('jp-postal')
    console.log(JSON.stringify(postal['1130021']))
    console.log(JSON.stringify(postal['0040000']))
    console.log(JSON.stringify(postal['4980000']))

    Output

    {"東京都":["文京区本駒込"]}
    {"北海道":["札幌市厚別区","札幌市清田区"]}
    {"愛知県":["弥富市"],"三重県":["桑名郡木曽岬町"]}
    

    How to rebuild

    To rebuild to obtain the latest database

    yarn
    yarn rebuild

    or

    npm install
    npm run rebuild

    See package.json for the detailed commands

    Test

    yarn test

    Install

    npm i jp-postal

    DownloadsWeekly Downloads

    53

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    20.8 MB

    Total Files

    6

    Last publish

    Collaborators

    • tranvansang