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

libgn

v0.0.2

Published

Manipulate geographical and administrative data about Guinea.

Readme

libgn

libgn is a TypeScript/JavaScript library that makes it easy to access and manipulate geographical and administrative data about Guinea.

NPM Version

Installation

npm install libgn

or with pnpm:

pnpm add libgn

Usage

import libgn from "libgn";

// Get all regions of Guinea
console.log(libgn.allRegionNames);
// Result: ["Boké", "Conakry", "Faranah", "Kankan", "Kindia", "Labé", "Mamou", "N'Zérékoré"]

// Get basic information about Guinea
console.log(libgn.basicInfo);
// Result: { name: "Guinée", capital: "Conakry", motto: "Travail, Justice, Solidarité", ... }

API Reference

General Information

// Basic information about Guinea
libgn.basicInfo
// Returns: { name, capital, motto, flag, isoCode, callingCode, population, area, currency }

// Capital
libgn.capital
// Returns: "Conakry"

// Languages
libgn.languages
// Returns: { official: "Français", national: ["Pular", "Maninka", "Susu", ...] }

Regions

// All regions with their complete data
libgn.allRegions
// Returns: Array<Region>

// Names of all regions
libgn.allRegionNames
// Returns: ["Boké", "Conakry", "Faranah", "Kankan", "Kindia", "Labé", "Mamou", "N'Zérékoré"]

// Codes of all regions
libgn.allRegionCodes
// Returns: ["BK", "CK", "FR", "KK", "KD", "LB", "MM", "NZ"]

// Prefectures of a specific region
libgn.getPrefecturesByRegion("Conakry")
// Returns: ["Conakry"]

// Population of a region
libgn.getRegionPopulation("Conakry")
// Returns: 1667864

// Area of a region (in km²)
libgn.getRegionArea("Conakry")
// Returns: 450

Prefectures

// All prefectures
libgn.allPrefectureNames
// Returns: ["Boké", "Boffa", "Fria", "Gaoual", "Koundara", "Conakry", ...]

// Sub-prefectures of a prefecture
libgn.getSubPrefecturesByPrefecture("Conakry")
// Returns: ["Kaloum", "Dixinn", "Matam", "Ratoma", "Matoto"]

// Region of a prefecture
libgn.getRegionOfPrefecture("Conakry")
// Returns: "Conakry"

Neighborhoods (Conakry only)

// All neighborhoods of Conakry
libgn.allNeighborhoods
// Returns: ["Miniere Cité Secteur 2", "KASSA", "BOULBINET", ...]

// Neighborhoods of a specific sub-prefecture
libgn.getNeighborhoodsBySubPrefecture("Dixinn")
// Returns: ["Miniere Cité Secteur 2", "Cameroun Secteur 1", ...]

Error Handling

The library includes specific error classes for better error handling:

import {
  RegionReferenceError,
  PrefectureReferenceError,
  SubPrefectureReferenceError
} from "libgn";

try {
  libgn.getPrefecturesByRegion("Non-existent region");
} catch (error) {
  if (error instanceof RegionReferenceError) {
    console.log("Region not found");
  }
}

Development

# Install dependencies
pnpm install

# Compile TypeScript
pnpm build:pkg

# Development mode (watch)
pnpm dev

# Run tests
pnpm test

# Run tests once
pnpm test:run

# Generate coverage report
pnpm test:coverage

# Linting
pnpm lint

# Linting with auto-fix
pnpm lint:fix

Included Data

  • 8 administrative regions
  • 34 prefectures (official administrative divisions)
  • 8 urban communes (including Conakry's 5 communes)
  • Sub-prefectures for each prefecture
  • Detailed neighborhoods (Conakry only)
  • Demographic information (population, area)
  • Geographical and administrative data
  • Cultural information (languages, currency, etc.)

License

This package is published under MIT License

Support

If you have questions or need help regarding this package, don't hesitate to open an issue on GitHub.