npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

oman-states-and-cities

v1.0.3

Published

Oman Database for states and cities

Readme

OmanStatesAndCities

A database containing information about cities and states in Oman, including slugs, location codes, and coordinates. This package provides methods to filter cities and states based on their type and access all location data.

Features

  • Provides a list of cities and states in Oman.
  • Includes location details like labels (Arabic and English), latitude, longitude, and unique location codes.
  • Supports filtering cities and states separately.

Installation

To install the package, run the following command:

npm install [email protected]

Usage Importing the module You can import the module into your JavaScript or TypeScript project like this:

import { getCities, getStates, allLocations } from "oman-states-and-cities";
Fetching Cities
Use the getCities function to get all cities in Oman:


const cities = getCities();
console.log(cities);
Fetching States
Use the getStates function to get all states in Oman:


const states = getStates();
console.log(states);
Accessing All Locations
You can access all locations, including both cities and states, using the allLocations variable:


const locations = allLocations;
console.log(locations);

Location Type Definition The locations are typed as follows:


type Location = {
  slug: string; // Unique identifier for the location (e.g., "adam")
  label_ar: string; // Name of the location in Arabic (e.g., "أدم")
  label_en: string; // Name of the location in English (e.g., "Adam")
  url_name: string; // URL-friendly name for the location (e.g., "adam")
  type: locationType; // Type of location, can be either "city" or "state"
  parent_slug: string; // Parent region or state slug (e.g., "al-dakhiliya")
  location: string; // A unique location code (e.g., "0101000020E6100000EC51B81E85C34C40C7BAB88D06603640")
  lat: number; // Latitude coordinate of the location (e.g., 22.3751)
  lng: number; // Longitude coordinate of the location (e.g., 57.5275)
};

type LocationList = Location[];

export type locationType = "city" | "country" | "state";

Example Data Here is an example of a location object:

{
  "slug": "adam",
  "label_ar": "أدم",
  "label_en": "Adam",
  "url_name": "adam",
  "type": "city",
  "parent_slug": "al-dakhiliya",
  "location": "0101000020E6100000EC51B81E85C34C40C7BAB88D06603640",
  "lat": 22.3751,
  "lng": 57.5275
}

License This project is licensed under the MIT License.

Author This package was created by Said Alhajri, a developer from Oman. Follow me on Twitter @boyhaxdev.