Skip to content

Commit

Permalink
Merge pull request #2 from sajaddp/update-source
Browse files Browse the repository at this point in the history
Update source
  • Loading branch information
mohammad-hassani authored Oct 9, 2022
2 parents a379310 + 88bc7ab commit 838366d
Show file tree
Hide file tree
Showing 12 changed files with 124 additions and 6,983 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "list-of-cities-in-Iran"]
path = list-of-cities-in-Iran
url = [email protected]:sajaddp/list-of-cities-in-Iran.git
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,44 @@ npm install iran-city

## Usage example

var iranCity = require('iran-city');
var AllCities = iranCity.allCities();
var AllProvinces = iranCity.allProvinces();
var CitiesOfProvince = iranCity.citiesOfProvince(20);
var SearchByName = iranCity.searchByName('کرمان');
var CityByName = iranCity.cityByName('رفسنجان');
var CityById = iranCity.cityById(766);

```js
let iranCity = require('iran-city');
let AllCities = iranCity.allCities();
let AllProvinces = iranCity.allProvinces();
let CitiesOfProvince = iranCity.citiesOfProvince(20);
let SearchByName = iranCity.searchByName('کرمان');
let CityByName = iranCity.cityByName('رفسنجان');
let CityById = iranCity.cityById(766);
```

## Modules

allCities() : will return an array of all cities

allProvinces() : will return an array of all provinces
```js
allCities() // will return an array of all cities

citiesOfProvince(provinceID) : will return an array of all cities of a specific province by province id
allProvinces() // will return an array of all provinces

searchByName('province name') : will return an array of all cities of a specific province by province name
citiesOfProvince(provinceID) // will return an array of all cities of a specific province by province id

cityByName('city name') : will return all city data by searching name of city
searchByName('province name') // will return an array of all cities of a specific province by province name

cityById(cityID) : will return all city data by searching id of city
cityByName('city name') // will return all city data by searching name of city

#### you can find examples in src/index.js
cityById(cityID) // will return all city data by searching id of city
```

### for make dist folder:
* You can find examples in `src/index.js`

```npx tsc --resolveJsonModule```
* For make dist folder

### for run index file
```shell
npx tsc --resolveJsonModule
```

```node dist/src/index.js```
* For run index file

```shell
node dist/src/index.js
```

### Thanks to @sajaddp for the help
* Thanks to [@sajaddp](https://github.com/sajaddp) for the help
Loading

0 comments on commit 838366d

Please sign in to comment.