0.0.2 • Published 2 years ago

cityir v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

🌍 Iran Provinces Full List

A npm package for get provinces and cities from divar.ir | opensource iran provinces and cities

⚙️ Usage

There are two async function :

Function nameDescription
Just Listconst {justProvinces} = require('cityir')returns a Promise to fetch Array of all provinces online
List with citiesconst {provinces} = require('cityir')returns a Promise to fetch Array of all provinces with cities of each province online
Just Listconst {justProvinces} = require('cityir').offlinereturns an Array of all provinces offline
List with citiesconst {provinces} = require('cityir').offlinereturns an Array of all provinces with cities of each province offline

Examples

// async example to fetch online data
const { justProvinces, provinces } = require('cityir')

async  function  run() {
 const [pureList, fullList] = [await  justProvinces(), await  provinces()]
 console.table(pureList)
 console.table(fullList)
}
run()
// sync offline data - read from cached file
const { justProvinces, provinces } = require('cityir').offline

console.table(justProvinces)
console.table(provinces)