# @datagica/parse-locations

> location parser

Latest version **0.0.8** (published 2017-07-18) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @datagica/parse-locations
pnpm add @datagica/parse-locations
yarn add @datagica/parse-locations
bun add @datagica/parse-locations
```

## 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.8 |
| Published | 2017-07-18 |
| First published | 2016-05-05 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Julian Bilcke |
| Maintainers | datagica |

## Links

- npm: https://www.npmjs.com/package/@datagica/parse-locations
- Repository: https://bitbucket.org/datagica/parse-locations
- Homepage: https://bitbucket.org/datagica/parse-locations#readme
- npm.io page: https://npm.io/package/@datagica/parse-locations

## Dependencies (1)

- [@datagica/parse-cities](https://npm.io/package/@datagica/parse-cities.md) ^0.0.15

## Recent versions

- 0.0.8 (latest) — 2017-07-18
- 0.0.7 — 2017-07-18
- 0.0.6 — 2017-07-17
- 0.0.5 — 2017-07-17
- 0.0.4 — 2017-07-10
- 0.0.3 — 2017-07-08
- 0.0.2 — 2016-05-13
- 0.0.1 — 2016-05-08
- 0.0.0 — 2016-05-05

## README

# @datagica/parse-locations

Extract locations from a document. Takes some times for the first call to load the city database.

Based on `@datagica/parse-cities` which is a bit fat module, the last version is too large to be on NPM so I used a git+ssh dependency link.

## Installation

```
$ npm install --save @datagica/parse-locations
```

## Usage

```javascript
import parseLocations from "@datagica/parse-locations";

parseLocations("Pierre Dupont. 12345\. Saint-léger-du-malzieu en France.").then(..).catch(..)
// will output:
[
  {
      "ngram": "Saint-léger-du-malzieu en France",
      "value": {
          "id": "fr-saint-léger-du-malzieu",
          "countryCode": "FR",
          "country": "France",
          "label": {
              "en": "Saint-léger-du-malzieu, France"
          },
          "aliases": ["Saint-léger-du-malzieu France"],
          "location": [44.8881, 3.3094]
      },
      "score": 1,
      "position": {
          "substring": {
              "begin": 33,
              "end": 65
          },
          "fullstring": {
              "begin": 33,
              "end": 65
          }
      }
  }
]
// pretty cool right?
```

---
_Source: https://npm.io/package/@datagica/parse-locations · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
