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

get-my-citiess

v1.2.1

Published

a simple lib to city names with unique ids

Downloads

6

Readme

Get My Cities

Created this as a place so that others are welcome to contribute with their own cities to this library. Ultimately making it a library with city names of most countries at our disposal whenever we need. Whats special here is that I aim to store city names in their own native characters as well as in English.

Status

Currently I have only added cities in following countries. But they are not fully completed I still need to work on them as well. 🇱🇰 🇹🇼

Features

For now this only have two functions available. One to retrieve cities by giving its country_code and pick one city using its id and relevant country_code.

Getting Started

Prerequisites

node: >= v8.3

Installing

Using npm

npm install --save get-my-citiess
npm i get-my-citiess

Using Yarn

yarn add get-my-citiess

Example Usage

// getting available cities according to a country code and locale given
import { readCities } from 'get-my-citiess';

const getAllCities = async () => {
    const listOfCities = await readCities('LK', 'en'); // to get thaiwan cities in chinese `readCities('TW', 'zh')
}

// getting a particular city by giving country code, locale and its Id
import { getACity, } from 'get-my-citiess';

const getThatCity = async (id) => {
    const listOfCities = await getACity('LK', 'en', 5);
}

// getting districts for a city when districts are divided according to cities
const getDistrictsForCity = async (id) => {
    const districts = await getCitysDistricts('TW', 'en', 2);
}

// getting rezones for a city when available
const getRezones = async (id) => {
    const districts = await getRezoneList('TW', 'en', 2);
}