# osrm-client-promise

> Client library for OSRM with promises

Latest version **0.0.3** (published 2016-06-23) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install osrm-client-promise
pnpm add osrm-client-promise
yarn add osrm-client-promise
bun add osrm-client-promise
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-06-23 |
| First published | 2016-05-12 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Rocco De Patto |
| Maintainers | lesion |
| Keywords | osrm, routing, TSP |

## Links

- npm: https://www.npmjs.com/package/osrm-client-promise
- Repository: https://github.com/lesion/osrm-client-promise
- Homepage: https://github.com/lesion/osrm-client-promise#readme
- Issues: https://github.com/lesion/osrm-client-promise/issues
- npm.io page: https://npm.io/package/osrm-client-promise

## Dependencies (2)

- [es6-promise](https://npm.io/package/es6-promise.md) ^3.2.1
- [isomorphic-fetch](https://npm.io/package/isomorphic-fetch.md) ^2.2.1

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2016-06-23
- 0.0.2 — 2016-05-12
- 0.0.1 — 2016-05-12

## README

## osrm-client-promise

An isomorphic promising OSRM client (v4)

## API
All osrm-backend v4 api is supported, please take a look at [documentation](https://github.com/Project-OSRM/osrm-backend/wiki/Server-API---v4,-old):


| Service     |           Description                                     |
|-------------|-----------------------------------------------------------|
| [viaroute](https://github.com/Project-OSRM/osrm-backend/wiki/Server-API---v4,-old#service-viaroute)  | shortest path between given coordinates                   |
| [nearest](https://github.com/Project-OSRM/osrm-backend/wiki/Server-API---v4,-old#service-nearest)   | returns the nearest street segment for a given coordinate |
| [table](https://github.com/Project-OSRM/osrm-backend/wiki/Server-API---v4,-old#service-table)     | computes distance tables for given coordinates            |
| [match](https://github.com/Project-OSRM/osrm-backend/wiki/Server-API---v4,-old#service-match)     | matches given coordinates to the road network             |
| [trip](https://github.com/Project-OSRM/osrm-backend/wiki/Server-API---v4,-old#service-trip)      | Compute the shortest round trip between given coordinates

## Usage example

```javascript
// instantiate a new client (without arg `http://router.project-osrm.org` will be used)
let osrm = new OSRMClient('http://localhost:5000')

osrm.nearest([52.4224,13.333086])
.then(ret => { 
  console.log(ret)
  // {
  //    "status": 200,
  //    "mapped_coordinate": [52.42259, 13.33383],
  //    "name": "Mariannenstraße" 
  // } 
})


osrm.trip({loc: [45, 8], [45.1, 8.1]})

```

---
_Source: https://npm.io/package/osrm-client-promise · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
