Skip to content

I tried to create this package entirely from scratch using node js and json data in an effort to challenge myself and try something new. This package's goal is to make a list of all Moroccan cities' names for use by developers across the board. and in less than a week, he had 300 downloads, I suppose this is a good start.

abdelhaq-laachari/Moroccan-cities

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

List of Moroccan cities

Table Of Content

About

All Moroccan cities and their regions are contained in this package, which was created by a Moroccan JavaScript student.
you can use this package with react select library and create a custom select with search button.

Installation

npm install list-of-moroccan-cities
yarn add list-of-moroccan-cities

Usage

For Cities

const { cities } = require("list-of-moroccan-cities");

it's will return an array of objects like this

[
  {
    "id": "0",
    "name": "Afourar",
    "label": "Afourar"
  },
  {
    "id": "1",
    "name": "Agadir",
    "label": "Agadir"
  }
]

For regions

const { regions } = require("list-of-moroccan-cities");

it's will return an array of objects like this

[
  {
    "id": "1",
    "name": "Tanger-Tétouan-Al Hoceïma",
    "region": "Tanger-Tétouan-Al Hoceïma"
  },
  {
    "id": "2",
    "name": "l'Oriental",
    "region": "l'Oriental"
  }
]

For each city and its region

const { citiesWithRegion } = require("list-of-moroccan-cities");

it's will return an array of objects like this

[
  {
    "id": "0",
    "name": "Afourar",
    "label": "Afourar",
    "region": "Béni Mellal-Khénifra"
  },
  {
    "id": "1",
    "name": "Agadir",
    "label": "Agadir",
    "region": "Souss-Massa"
  }
]

Thanks for

I'm using this person's Alaouy repository to build this package, so I want to give him a big thank thanks. his repository data

License

MIT

About

I tried to create this package entirely from scratch using node js and json data in an effort to challenge myself and try something new. This package's goal is to make a list of all Moroccan cities' names for use by developers across the board. and in less than a week, he had 300 downloads, I suppose this is a good start.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published