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

rwanda

v3.0.2

Published

This package provides you access to provinces, districts, sectors, villages and cells found in Rwanda

Readme

rwanda

npm npm License: MIT TypeScript

A comprehensive TypeScript/JavaScript library for accessing administrative divisions of Rwanda. This package provides type-safe access to provinces, districts, sectors, cells, and villages in Rwanda.

Rwanda is administratively organized into:

  • 5 Provinces (including Kigali City)
  • 30 Districts
  • 416 Sectors
  • 2,148 Cells
  • 14,837 Villages

Installation

# Using npm
npm install rwanda

# Using yarn
yarn add rwanda

# Using pnpm
pnpm add rwanda

Usage

JavaScript (CommonJS)

const { Provinces, Districts } = require('rwanda');

console.log(Provinces());
// Output: ['East', 'Kigali', 'North', 'South', 'West']

console.log(Districts('kigali'));
// Output: ['Gasabo', 'Kicukiro', 'Nyarugenge']

TypeScript / ES Modules

import { Provinces, Districts, Sectors } from 'rwanda';

// Get all provinces
const provinces: string[] = Provinces();

// Get districts in Kigali
const kigaliDistricts: string[] = Districts('kigali');

// Get sectors in Gasabo district
const gasaboSectors: string[] = Sectors('kigali', 'gasabo');

API Reference

Provinces(): string[]

Returns an array of all provinces in Rwanda.

import { Provinces } from 'rwanda';

const provinces = Provinces();
// Returns: ['East', 'Kigali', 'North', 'South', 'West']

Districts(province?: string): string[] | undefined

  • province (optional): Name of the province to filter districts

Returns an array of districts. If a province is provided, returns only districts in that province.

import { Districts } from 'rwanda';

// Get all districts in Rwanda
const allDistricts = Districts();

// Get districts in Kigali
const kigaliDistricts = Districts('kigali');
// Returns: ['Gasabo', 'Kicukiro', 'Nyarugenge']

Sectors(province?: string, district?: string): string[] | undefined

  • province (optional): Name of the province
  • district (optional): Name of the district to filter sectors

Returns sectors based on the provided filters.

import { Sectors } from 'rwanda';

// Get all sectors in Rwanda
const allSectors = Sectors();

// Get sectors in Gasabo district, Kigali
const gasaboSectors = Sectors('kigali', 'gasabo');

Cells(province?: string, district?: string, sector?: string): string[] | undefined

  • province (optional): Name of the province
  • district (optional): Name of the district
  • sector (optional): Name of the sector to filter cells

Returns cells based on the provided filters.

Villages(province?: string, district?: string, sector?: string, cell?: string): string[] | undefined

  • province (optional): Name of the province
  • district (optional): Name of the district
  • sector (optional): Name of the sector
  • cell (optional): Name of the cell to filter villages

Returns villages based on the provided filters.

Type Safety

The package includes TypeScript type definitions out of the box. All functions are properly typed:

// TypeScript will infer the return type as string[]
const districts: string[] = Districts('kigali');

// TypeScript will show an error for invalid province names
const invalid = Districts('invalid'); // TypeScript error

Case Insensitivity

All input parameters are case-insensitive:

// All these are equivalent
Districts('kigali');
Districts('Kigali');
Districts('KIGALI');

Error Handling

When invalid parameters are provided, the functions return undefined:

const result = Districts('Nonexistent Province');
console.log(result); // undefined
yarn add rwanda

Contributors