Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

suiteplus/zipcode-br

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zipcode-br

Build Status Coveralls Status

Required

  • node.js 4 +

Install Dependency StatusdevDependency Status

    npm install suiteplus/zipcode-br --save

Functionality

Create a json array of zipcodes from brazil using DNE (diretório nacional de endereços) files.

Usage

Create a json object with zipBand, location and config.

 var opts = {
        zipBand: './files/DELTA_LOG_FAIXA_LOC.txt',
        location: './files/DELTA_LOG_LOCALIDADE.txt',
        config: 0
    }
Param Type Description
opts.config string Set it to 0 if you want search files with separators(@) or 1 if you want the fixed.
opts.zipBand string It's the path to zipcode band if you set opts.config to 0 will be DELTA_LOG_FAIXA_LOC.TXT if 1 DNE_DLT_FAIXAS_CEP_LOCALIDADE.TXT. It can be a array of paths or only a string to the path.
opts.location string The same as zipBand but for the file DELTA_LOG_LOCALIDADE.txt if opts.config = 0 and DNE_DLT_LOCALIDADES.TXT if opts.config = 1. Can be a array to

Call the function.parse() passing the json to parse the files. example:

    zipcode.parse(opts);