higher-edu-morocco
v1.0.1
Published
Typed dataset & helpers for Moroccan universities and grandes écoles
Maintainers
Readme
Higher-Ed Morocco 🇲🇦
A simple, zero-dependency Node.js package providing structured and typed data about universities and higher-education institutions in Morocco.
📦 Installation
npm install higher-edu-moroccoOr via yarn/pnpm:
yarn add higher-edu-morocco
pnpm add higher-edu-morocco🚀 Usage
JavaScript/TypeScript
import {
getAllInstitutions,
filterInstitutionsByType,
filterInstitutionsByCity,
searchInstitutions,
} from "higher-edu-morocco";
// List all institutions
console.log(getAllInstitutions());
// Filter by type
console.log(filterInstitutionsByType("engineering_school"));
// Find by city
console.log(filterInstitutionsByCity("Rabat"));
// Find by state recognition
console.log(filterInstitutionsByRecognition(true));
// Fuzzy search
console.log(searchInstitutions("ENSA"));CLI Usage
Run commands directly using npx:
npx higher-edu-ma list
npx higher-edu-ma list --type engineering_school
npx higher-edu-ma list --city Casablanca
npx higher-edu-ma search ENSA📖 API
getAllInstitutions(): Institution[]
Returns an array of all Moroccan higher-education institutions.
filterInstitutionsByType(id: string): Institution | undefined
Fetches a single institution by its unique id.
filterInstitutionsByType(type: InstitutionType): Institution[]
Returns institutions filtered by type (public_university, private_university, engineering_school, etc.).
filterInstitutionsByCity(city: string): Institution[]
Returns institutions located in a specified city.
filterInstitutionsByRecognition(recognized: boolean | undefined): Institution[]
Returns institutions with a specified state recognition status (true, false, or undefined).
searchInstitutions(term: string): Institution[]
Fuzzy searches institutions by name or city.
🔍 Data Schema
Each institution has:
interface Institution {
id: string; // Unique slug identifier
name: string; // Official institution name
city: string; // Main campus city
type: InstitutionType;
website: string; // Official website URL
phone: string; // Phone number
recognized_by_state: boolean | undefined; // State recognition status
address: string; // Street address
lat: number; // Latitude
lng: number; // Longitude
}🛠 CLI Reference
Commands:
higher-edu-ma list # Lists all institutions
higher-edu-ma search <term> # Searches institutions by name or cityOptions:
--type, -t: Filter by institution type.--city, -c: Filter by city.--json, -j: Output as JSON.
Example:
higher-edu-ma list --type public_university
higher-edu-ma search Rabat --json🚨 Issues & Contributions
Report issues or contribute on GitHub:
📜 License
MIT © Anas Behhari
