openstreetmap-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

A simple API Wrapper for OpenStreetMap in Typescript.

This package provides a simple wrapper for the usage of OpenStreetMap API in Node.js.

Supported APIs

Client Usage

Installation

yarn add openstreetmap-node

Initialize Client

import { OpenStreetMap } from "openstreetmap-node";

const client = new OpenStreetMap();

Lookup Postal Code

    // Single lookup
    // returns a single object {lat: number, lon: number, country: string}
    const singleLookup = await client.fetchCoordinates("90210", "US");
    
    // Bulk lookup
    // returns an array of objects [{lat: number, lon: number, country: string}]
    const bulkLookup =  await client.fetchCoordinates(["90210", "93108"], "US");
    
    // Multiple countries
    // returns an array of objects [{lat: number, lon: number, country: string}]
    const multipleCountries =  await client.fetchCoordinates([{zip: "90210", country: "US"}, {zip: "10243", country: "DE"}]);

Created under the MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i openstreetmap-node

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

7.9 kB

Total Files

14

Last publish

Collaborators

  • christianobora