• Stars
    star
    267
  • Rank 153,621 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐ŸŒ† All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array.

all-the-cities

All the 138,398 cities of the world with a population of at least 1000 inhabitants, in a big JSON array that is ready to be imported in MongoDB for geoSpatialSearch.

Derived from the cities-with-1000 npm package, which in turn came from geonames.org data.

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install all-the-cities --save

Usage

const cities = require('all-the-cities');

cities.filter(city => city.name.match('Albuquerque'));

/*
 [{
   cityId: '5454711',
   name: 'Albuquerque',
   country: 'US',
   altCountry: '',
   muni: '',
   muniSub: '',
   featureClass: 'P',
   featureCode: 'PPLA2',
   adminCode: 'NM',
   population: 545852,
   loc: {
     type: 'Point',
     coordinates: [-106.65114, 35.084] 
   }
 }, {
   cityId: '5476960',
   name: 'Los Ranchos de Albuquerque',
   country: 'US',
   altCountry: '',
   muni: '',
   muniSub: '',
   featureClass: 'P',
   featureCode: 'PPL',
   adminCode: 'NM',
   population: 6024,
   loc: {
     type: 'Point',
     coordinates: [-106.6428, 35.16199]
   }
 }]
*/

Fields available to import

id - Id of the city (same in openWeatherMap)
name
altName
country
featureCode
adminCode
population
loc: { type: 'Point', coordinates: [0, 0] }

for **GEO JSON data**, a particular format is needed in MongoDB Schema as written in loc field above

Tests

npm install
npm test

Dependencies

None

Dev Dependencies

  • cities-with-1000: lat/lon, names of cities with over 1000 people
  • tape: tap-producing test harness for node and browsers
  • split2: split a Text Stream into a Line Stream, using Stream 3
  • through2: A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise

License

MIT

More Repositories

1

semantic-pull-requests

๐Ÿค– Let the robots take care of the semantic versioning
JavaScript
1,238
star
2

package-json-to-readme

Generate README.md from package.json contents
JavaScript
369
star
3

livestory

Tell a story and get a live feed of images.
JavaScript
133
star
4

npe

Node Package Editor: a CLI for one-off inspection and editing of properties in package.json files.
JavaScript
92
star
5

remind-me

A command-line reminder tool that supports natural language dates and times, inspired by Slack's remind feature (UNMAINTAINED)
JavaScript
81
star
6

standard-markdown

๐Ÿ“ Test your Markdown files for Standard JavaScript Styleโ„ข
JavaScript
75
star
7

npm-collection-http-clients

A review of HTTP clients for Node.js and browsers
59
star
8

euclidean-distance

Calculate the Euclidean distance been two points in 2D/3D/nD space.
JavaScript
52
star
9

npm-collection-language-tools

A collection of npm modules for working with words and language
51
star
10

illuminati

๐Ÿ‘ A minimalist webcam app for your desktop
JavaScript
48
star
11

nearby-cities

Give me your coordinates and I'll tell you where the nearest cities are.
JavaScript
44
star
12

semantic-release-with-github-actions

A demo showing how to publish npm packages automatically (and semantically)
JavaScript
39
star
13

check-for-leaks

a tool to help avoid publishing secrets to github and npm
JavaScript
37
star
14

slideshow

A harp template app for creating badass slide decks. (Unmaintained)
CSS
36
star
15

harp-buildpack

A Heroku buildpack for static sites, powered by Node.js and Harp [Deprecated] See http://harpjs.com/docs/deployment/heroku)
Shell
36
star
16

learning-leveldb-with-juliangruber

@zeke and @juliangruber talk about LevelDB
34
star
17

html-frontmatter

Extract key-value metadata from HTML comments
JavaScript
32
star
18

passive-income-with-cassidoo

A chat about passive income with @cassidoo
JavaScript
31
star
19

humanize-graphql-response

Clean up GraphQL repsonse objects by flattening nodes and edges into object arrays
JavaScript
27
star
20

replicate-prediction-to-video

Create a video file from a series of Replicate model output images
Python
26
star
21

atom-icon

A more physically accurate replacement icon for Github's Atom editor.
25
star
22

us-counties

๐Ÿ“A GeoJSON object containing geometries of every county in the US
JavaScript
23
star
23

canvas-polygon

Create polygons with the Canvas API
JavaScript
22
star
24

universe-22

:octocat: Slides for my talk at GitHub Universe 2022: Building an AI artist with Codespaces and Replicate.
JavaScript
22
star
25

markdown-index

Build a markdown table of contents for all the markdown files in a given directory tree.
JavaScript
19
star
26

add-local-binaries-to-path

Make locally-installed node modules executable by name by adding ./node_modules/.bin to the $PATH
JavaScript
18
star
27

gem.wtf

๐Ÿ’Ž Type a short URL to jump straight to a Ruby gem's repository page.
JavaScript
17
star
28

cloud

A CLI for uploading files to CloudApp
Ruby
16
star
29

github-raw-cors-proxy

Get raw json files from public github repos using CORS
JavaScript
15
star
30

acrophonic-alphabets

A collection of 92 Alpha-Bravo-Charlie-style alphabets from around the world.
JavaScript
13
star
31

zeke.sikelianos.com

My personal website
HTML
13
star
32

rainfall

A ruby gem CLI for downloading everything in your cloudapp account to your hard drive.
Ruby
13
star
33

tree-hugger

๐ŸŒณ Squeeze metadata from a tree of JSON, YAML, Markdown, and HTML files.
JavaScript
13
star
34

electron-developers

A collection of GitHub profiles of users who work on Electron-related projects
JavaScript
13
star
35

kid-chores

A bespoke open-source monospaced emoji chore list for kids
13
star
36

electron-shortcut-normalizer

Normalize electron keyboard shortcuts so they work on different operating systems
JavaScript
13
star
37

github-avatars

A machine learning model to detect whether a GitHub user has a custom or default avatar
Jupyter Notebook
12
star
38

harry-potter-words

terms you won't find in a muggle dictionary
JavaScript
11
star
39

standard-summary

Display output from `standard` as a list of style errors, ordered by count.
JavaScript
11
star
40

javascript-userland

My slides from dotjs.io Paris 2016
HTML
11
star
41

thief

Extract color palettes from images. [deprecated]
JavaScript
11
star
42

ratpack

A set of view helpers for Sinatra, inspired by ActionPack.
Ruby
11
star
43

arpabet

A JSON webservice that dishes out rhymes using ARPABET transcription matching.
Ruby
10
star
44

wikipedia-translator

Scrape translations from Wikipedia pages
JavaScript
10
star
45

marky-markdown-lite

A version of marky-markdown that does less.
JavaScript
9
star
46

hoods

Give me a lng/lat and I'll give you a neighborhood
JavaScript
9
star
47

path-is-fresh

๐ŸŒบ A human-friendly tool for checking file freshness
JavaScript
9
star
48

ml-ipsum

Lorem ipsum meets Machine Learning terminology
JavaScript
9
star
49

bitbucket-url-to-object

A node module that extracts useful properties like user, repo, and branch from various flavors of Bitbucket URLs.
JavaScript
9
star
50

git-audit

A ruby script that finds git repos with unstaged changes and/or unpushed commits.
Ruby
9
star
51

stratosphere

A general-purpose window that is always on top. Drop files and URLs onto it.
HTML
8
star
52

summarize-python-requirements

Annotate your Python requirements.txt file with summaries of each package.
Python
8
star
53

lobars

lodash functions as handlebars helpers
JavaScript
8
star
54

mysql_s3_backup_tool

A ruby script and cron file that back up a MySQL database to S3
Ruby
8
star
55

objectify-array

Recursively convert arrays of objects into a single keyed object tree
JavaScript
7
star
56

npm-collection-tools-for-testing

7
star
57

atom-npm

Atom package to open a selected npm package on npmjs.com or its repo on github.com
JavaScript
7
star
58

chronicle

Chronicle groups collections of ruby objects into time periods.
Ruby
7
star
59

lets-get-meta

Extract meta tags from an HTML string in Node.js (not browsers)
JavaScript
7
star
60

electron-universe

๐ŸŒ” The Electron app for my talks about Electron at GitHub Universe 2016 and 2017
CSS
7
star
61

browserify-babel-async-await-demo

A minimal demo of async/await working in a browser in April 2018.
JavaScript
6
star
62

ms-build-2019-talk

A talk about creating sustainable open-source projects, by @nerdneha and @zeke
HTML
6
star
63

schemeless

Remove the parts of URLs that humans don't really need to see.
JavaScript
6
star
64

firefox-history-analyzer

This is a ruby project that uses ActiveRecord to crack open Firefox 3's new Places SQLite browsing history and display info about it.
Ruby
6
star
65

devcenter-scraper

Download Heroku Dev Center content
CoffeeScript
6
star
66

handlebars-helper-equal

A Handlebars helper for testing equality
JavaScript
6
star
67

href-type

Test whether an href string is absolute, relative, protocol-relative, #fragment, mailto:, tel:, sms:, etc
JavaScript
6
star
68

dimensions

Get the width and height of any image on the Internet. Supports BMP, GIF, JPEG, PNG, PSD.
JavaScript
6
star
69

geoposition-to-object

Turn an HTML5 Geoposition object into a regular object that can be serialized with JSON.stringify
JavaScript
6
star
70

faves

Audit your machine to generate a list of the npm packages you use most.
JavaScript
5
star
71

scroll-fever

A progress bar that fills up as you scroll down the page
JavaScript
5
star
72

increment.io

A simple webservice for counting click-throughs and other events for URLs.
CoffeeScript
5
star
73

nyu-training-test

Sandbox for training LLama 2 using Replicate
JavaScript
5
star
74

envy-json

Read a javascript object, JSON string, or JSON file and replace values like '$foo' with process.env.foo
JavaScript
5
star
75

outcasts

Words that people on Twitter don't think are words.
Ruby
5
star
76

heads

Make parallel HEAD requests for an array of URLs and get back their HTTP status codes.
JavaScript
5
star
77

geotail

An invisible electron app that tracks your geolocation and logs it to disk.
JavaScript
5
star
78

california-license-plates

A silly tool to search the California DMV website for available custom license plate names.
JavaScript
4
star
79

letterpress-index

compendium of facts and figures about the beloved iOS game, prepared in the style of Harper's Index
Ruby
4
star
80

404_color_bars

The interweb equivalent of an off-air television.
4
star
81

browser-date-formatter

Format dates real fancy-like in the browser. Good for search engines and humans.
JavaScript
4
star
82

platform-utils

Helper functions for working with platform names in the Node.js vernacular (darwin, win32, linux). Works in Node.js and browsers.
JavaScript
4
star
83

as3_clip_flipper

Actionscript 3 classes for animated flipping of 'two-sided' display objects. (Think OS X Dashboard Widgets)
ActionScript
4
star
84

wordnik-ruby-example-rails

A barebones vanilla rails app demonstrating how to use the wordnik gem in rails.
Ruby
4
star
85

pkgs

Fetch npm registry metadata for a list of npm package names
JavaScript
4
star
86

food-coops

๐Ÿฅ• location data about food cooperatives in the US
JavaScript
4
star
87

monkey_patches

A gem that extends String, Array, and Object to add some handy functions.
Ruby
4
star
88

youglish-api-client

A Node.js client for the Youglish REST API
JavaScript
4
star
89

dotfiles

My dotfiles repository. There are many like it, but this one is mine.
Shell
4
star
90

npmwd

JavaScript
4
star
91

queriac

An experiment...
JavaScript
4
star
92

autoform

Autoform is a Rails plugin that makes it easy to dynamically auto-generate a form for an ActiveRecord object.
Ruby
4
star
93

language-names

names of languages in other languages; Uses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames and https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
HTML
4
star
94

count-array-values

Count the instances of each value in an array, ignoring any non-string values.
JavaScript
4
star
95

redact-url

A node module to redact or remove authentication data from URLs
JavaScript
3
star
96

folksonomatron

A sinatra app that takes a URL and gives back the URL's top tags from delicious.com
Ruby
3
star
97

tweeter

A thing that uses GitHub Actions and the Twitter API to tweet
3
star
98

json-to-html-experiment

A little browserify-friendly demo of rendering a JSON object as HTML with expandable and collapsible keys
JavaScript
3
star
99

wordle-with-friends

Choose your own wordles
HTML
3
star
100

oneoffs

a collection of random scripty goodies
Ruby
3
star