0.0.4 • Published 2 months ago

extract-location v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

High performance lib to Extract City and Country from any String

npm npm

Installation

npm i --save extract-location

Usage

import extractLocation from 'extract-location';

extractLocation( strongToSearch: string, countryToSearchIn: string ): undefined | {
    country: string,
    city?: string,
    reliability: 1 | 2 | 3
};

Usage examples

extractLocation("Location: Paris (16)");
{
    "country": "France",
    "city": "Paris",
    "reliability": 2
}
extractLocation("Paris, United States");
{
    "country": "United States",
    "city": "Paris",
    "reliability": 3
}
extractLocation("Paris, United States", "Canada");
{
    "country": "Canada",
    "city": "Paris",
    "reliability": 3
}
extractLocation("There is no location here");
undefined
0.0.4

2 months ago

0.0.3-1

2 months ago

0.0.3

2 months ago

0.0.2

3 months ago

0.0.1

3 months ago