Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
moroccan-regions-cities
Advanced tools
A Node.js package to handle Moroccan regions and cities.
Install the package via npm:
npm install moroccan-regions-cities
Here are the key functions provided by this package, along with descriptions, parameters, and usage examples.
getAllRegions: Returns a list of all Moroccan regions in specified language.
const { getAllRegions } = require('moroccan-regions-cities');
const regions = getAllRegions('french');
console.log(regions); Output: [{
regionId: 'ba12f287-a8ea-4b11-9445-122c5f2e6a6c',
regionName: 'Guelmim-Oued Noun'
},
{
regionId: '51e3d7bb-fc82-4201-a852-bee031abe895',
regionName: 'Laâyoune-Sakia El Hamra'
},...]
const { countMoroccanRegions } = require('moroccan-regions-cities');
const regionCount = countMoroccanRegions();
console.log(regionCount); Output: 12
---------------------------------------------------------
getAssignedMorrocanCities:
Returns a list of cities that are assigned to regions.
const { getAssignedMorrocanCities } = require('moroccan-regions-cities');
const assignedCities = getAssignedMorrocanCities('arabic');
console.log(assignedCities); Output: ['طنجة','أصيلا','القصر الكبير',...]
const { getUnassignedCities } = require('moroccan-regions-cities');
const unassignedCities = getUnassignedCities('french');</br>
console.log(unassignedCities); Output: ['Rich','Arbaoua','Sebta'...]
---------------------------------------------------------
getRegionCities:
Returns a list of cities within a specific region in the specified language.
const { getRegionCities } = require('moroccan-regions-cities');
const regionCities = getRegionCities();
console.log(regionCities); Output: ['Tanger','Tetouan','Alhoceima'...]
---------------------------------------------------------
countAllMoroccanCities:
Returns the total number of cities in Morocco.
const { countAllMoroccanCities } = require('moroccan-regions-cities');
const countMorrocanCities = countAllMoroccanCities();
console.log(countMorrocanCities); Output: 114
---------------------------------------------------------
countAssignedCities:
Returns the total count of cities that are assigned to regions.
const { countAssignedCities } = require('moroccan-regions-cities');
const countMorrocanAssignedCities = countAssignedCities();
console.log(countMorrocanAssignedCities); Output: 92
---------------------------------------------------------
countRegionCities:
Returns the total count of cities that are assigned to regions.
const { countRegionCities } = require('moroccan-regions-cities');
const countregionCities = countRegionCities();
console.log(countregionCities); Output: 9
Note: the Output is the number of cities of the first region of 'getAllRegions' list.
---------------------------------------------------------
countUnassignedCities:
Returns the total count of cities that are assigned to regions.
const { countUnassignedCities } = require('moroccan-regions-cities');
const countUnassignedcities = countUnassignedCities();
console.log(countUnassignedcities); Output: 22
const {functionName} = require('moroccan-regions-cities');
import {functionName} from 'moroccan-regions-cities';
import allFunction from 'moroccan-regions-cities';
then call the function like this : allFunction.functionName(?params)
We welcome contributions to improve and expand this package! Here are some ideas for potential features and improvements:
1. Additional Language Support:
2. Caching Frequently Accessed Data:
3. Adding States For Each City:
git https://github.com/Ezzagmoute-Hamza/moroccan-regions-cities.git
```bash
git checkout -b feature/add-new-feature-name
```
git add .
git commit -m "Add new feature: description"
git push origin feature/add-new-feature-name
FAQs
A Node.js package to handle Moroccan regions and cities.
The npm package moroccan-regions-cities receives a total of 9 weekly downloads. As such, moroccan-regions-cities popularity was classified as not popular.
We found that moroccan-regions-cities demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.