1.0.1 • Published 1 year ago

cities-1000-structured v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

cities-1000-structured

View code coverage on codecov

A low-memory, structured loader for the GeoNames.org cities-1000 dataset.

The package provides a generator that outputs each record in the data set, structured & parsed – ints & floats are converted to numbers, lists are converted to string[] arrays, and dates are converted to Date objects. See the schema for details.

The data file is bundled with the package so can be used offline, and the package uses no dependencies.

Usage

The default export function provides a generator which can be iterated to access each record without storing the entire dataset in memory:

import cities1000 from 'cities-1000-structured';

for (const record of cities1000()) {
  // `record` is an object containing that record's details
  console.log(`Record #${record.geonameId}: "${record.name}"`, record);
}

Module under MIT License, geo data via GeoNames.org, CC BY 4.0.

1.0.1

1 year ago

1.0.0

1 year ago

0.0.1-security

1 year ago