0.3.2 • Published 10 years ago

zip-code-jp-stream v0.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

zip-code-jp-stream

npm version Build Status Dependency Status

It provides a stream for reading the data of the japanese postal code.

Basic usage

This module supports the stream of CSV / ZIP format.

Stream of ZIP file

By using the createFromZipFile, it can be read the data from the ZIP format of the file.

const stream = require('zip-code-jp-stream'); 
const reader = stream.createFromZipFile('../ken_all.zip');

reader.on('data', (r) => {
  console.log(r); // CSV record object
});

reader.on('end', () => {
  console.log('end');
});

Stream of CSV file

You can generate the CSV of the stream.

const stream = require('zip-code-jp-stream'); 
const reader = stream.createFromCSVFile('../ken_all.csv');

reader.on('data', (r) => {
  console.log(r); // CSV record object
});

reader.on('end', () => {
  console.log('end');
});

Object format

Format of the object that will be called from the stream is as follows.
For the string, it has been converted from Shift_JIS to UTF8.

プロパティ説明
jis_code全国地方公共団体コード(JIS X0401、X0402)
legacy_zip_code(旧)郵便番号(5桁)
zip_code郵便番号(7桁)
prefecture_kana都道府県名
city_kana市区町村名
area_kana町域名
prefecture都道府県名
city市区町村名
area町域名
tow_zip_code_display一町域が二以上の郵便番号で表される場合の表示
number_of_address_display小字毎に番地が起番されている町域の表示 (注4) (「1」は該当、「0」は該当せず)
city_block_display丁目を有する町域の場合の表示 (「1」は該当、「0」は該当せず)
one_zip_code_display一つの郵便番号で二以上の町域を表す場合の表示 (注5) (「1」は該当、「0」は該当せず)
changed_status更新の表示(注6)(「0」は変更なし、「1」は変更あり、「2」廃止(廃止データのみ使用))
changed_reason変更理由 (「0」は変更なし、「1」市政・区政・町政・分区・政令指定都市施行、「2」住居表示の実施、「3」区画整理、「4」郵便区調整等、「5」訂正、「6」廃止(廃止データのみ使用))

Execution of the test

  1. install node modules

    npm install
  2. running the test

    npm test
0.3.2

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago