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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@nishansanjuka/srilanka_geographics

v0.0.1

Published

## Sri Lanka Geographic Informations

Downloads

5

Readme

Project Overview

Sri Lanka Geographic Informations

Provinces, Districts, Cities - Oh My!

Unleash the power of geographical data with our npm library that provides seamless access to detailed information about provinces, districts, and cities. Whether you're building a location-based app, analyzing regional trends, or just curious about the world around you, our library has got you covered.

Table of Contents

Introduction

Welcome to the world of geographic exploration and seamless data retrieval! Our npm library, @nishansanjuka/srilanka_geographics, is designed to empower developers, data enthusiasts, and curious minds with comprehensive information about provinces, districts, and cities from around the globe.

Features

  • 🌍 Local Reach: Explore comprehensive data on provinces from the Sri Lanka.
  • 🏙️ City Insights: Dive deep into districts and uncover the cities that make them unique.
  • 🚀 Effortless Integration: Integrate our library seamlessly into your project with just a few lines of code.
  • 📚 Documentation Delight: Clear and concise documentation makes using our library a breeze.

Installation

npm install @nishansanjuka/srilanka_geographics

Usage

Getting All The Provinces is Look Likes This

const { GetAllProvinces, GetProvince, GetAllDistricts, GetDistrict, GetAllCities, GetCities } = require('@nishansanjuka/srilanka_geographics');

const allProvinces = await GetAllProvinces();
console.log(allProvinces);

Documentation

getData()

Description

This asynchronous function reads data from the specified file path and returns an array of Province objects.

Input

  • None

Output

  • Returns a Promise resolving to an array of Province objects.

GetAllProvinces()

Description

Retrieves all provinces with their basic details.

Input

  • None

Output

  • Returns a Promise resolving to an array of Province objects with properties id, name_en, name_si, and name_ta.

GetAllDistricts()

Description

Retrieves all districts with their details within each province.

Input

  • None

Output

  • Returns a Promise resolving to an array of District objects with properties id, province_id, name_en, name_si, and name_ta.

GetAllCities()

Description

Retrieves all cities within all districts across provinces.

Input

  • None

Output

  • Returns a Promise resolving to an array of city objects.

GetProvince(province: string, districts: boolean, city: boolean)

Description

Retrieves details of a specific province based on the provided name. Optional parameters districts and city determine whether to include district and city details.

Input

  • province (string): Name of the province.
  • districts (boolean): Include district details (default: false).
  • city (boolean): Include city details within districts (default: false).

Output

  • Returns a Promise resolving to a Province object with optional districts and city details.

GetDistrict(district: string, cities: boolean)

Description

Retrieves details of a specific district based on the provided name. Optional parameter cities determines whether to include city details within the district.

Input

  • district (string): Name of the district.
  • cities (boolean): Include city details within the district (default: false).

Output

  • Returns a Promise resolving to a District object with optional cities details.

GetCities(district: string)

Description

Retrieves all cities within a specific district.

Input

  • district (string): Name of the district.

Output

  • Returns a Promise resolving to an array of city objects within the specified district.

License

@nishansanjuka/srilanka_geographics is licensed under the MIT License - see the LICENSE file for details.