cityir

0.0.2 • Public • Published

🌍 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)

/cityir/

    Package Sidebar

    Install

    npm i cityir

    Weekly Downloads

    0

    Version

    0.0.2

    License

    ISC

    Unpacked Size

    106 kB

    Total Files

    9

    Last publish

    Collaborators

    • ahmdilloo