🌍 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 name | Description | |
---|---|---|
Just List | const {justProvinces} = require('cityir') |
returns a Promise to fetch Array of all provinces [online] |
List with cities | const {provinces} = require('cityir') |
returns a Promise to fetch Array of all provinces with cities of each province [online] |
Just List | const {justProvinces} = require('cityir').offline |
returns an Array of all provinces [offline] |
List with cities | const {provinces} = require('cityir').offline |
returns 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)