Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
meabed committed Dec 4, 2023
1 parent 2d0ecca commit 210aaef
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 552 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Phone Number information lookup, validation, carrier name, geo and timezone infos

[![NPM version](https://badgen.net/npm/v/@devmehq/phonenumber-js)](https://npm.im/@devmehq/phonenumber-js)
[![Build Status](https://github.com/devmehq/phonenumber-js/workflows/CI/badge.svg)](https://github.com/devmehq/phonenumber-js/actions)
[![Downloads](https://img.shields.io/npm/dm/phonenumber-js.svg)](https://www.npmjs.com/package/phonenumber-js)
[![UNPKG](https://img.shields.io/badge/UNPKG-OK-179BD7.svg)](https://unpkg.com/browse/@devmehq/phonenumber-js@latest/)
[![NPM version](https://badgen.net/npm/v/@devmehq/phone-number-validator-js)](https://npm.im/@devmehq/phone-number-validator-js)
[![Build Status](https://github.com/devmehq/phone-number-validator-js/workflows/CI/badge.svg)](https://github.com/devmehq/phone-number-validator-js/actions)
[![Downloads](https://img.shields.io/npm/dm/phone-number-validator-js.svg)](https://www.npmjs.com/package/phone-number-validator-js)
[![UNPKG](https://img.shields.io/badge/UNPKG-OK-179BD7.svg)](https://unpkg.com/browse/@devmehq/phone-number-validator-js@latest/)

This library includes the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles [libphonenumber](https://github.com/google/phonenumber-js) libraries but not in [libphonenumber-js](https://gitlab.com/catamphetamine/phonenumber-js) (a port of libphonenumber).
This library includes phone number lookup and validation, and the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles [libphonenumber](https://github.com/google/libphonenumber) libraries.

To reduce the amount of data that needs to be loaded to geocode / carrier map a phone-number for each mapping only the relevant number prefixes are loaded from a binary json file (BSON).
When the prefix could not be found in the provided locale the library tries to fall back to `en` as locale.

To reduce the amount of data that needs to be loaded to geocode / carrier map a phonenumber for each mapping only the relevant number prefixes are loaded from a binary json file (BSON).
When the prefix could not be found in the provided locale the library tries to fallback to `en` as locale.
The library supports Node.js only at the moment.

## API / Cloud Hosted Service
Expand All @@ -20,13 +21,13 @@ We offer this `phone verification and validation and more advanced features` in
## Installation

```sh
npm install @devmehq/phonenumber-js
npm install @devmehq/phone-number-validator-js
```

or

```sh
yarn add @devmehq/phonenumber-js
yarn add @devmehq/phone-number-validator-js
```

## Usage
Expand All @@ -40,7 +41,7 @@ The available methods are:
## Examples

```js
import { geocoder, carrier, timezones, parsePhoneNumberFromString } from '@devmehq/phonenumber-js'
import { geocoder, carrier, timezones, parsePhoneNumberFromString } from '@devmehq/phone-number-validator-js'

const fixedLineNumber = parsePhoneNumberFromString('+41431234567')
const locationEN = geocoder(fixedLineNumber) // Zurich
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@devmehq/phonenumber-js",
"name": "@devmehq/phone-number-validator-js",
"version": "1.2.8",
"description": "This library includes the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles libphonenumber libraries",
"keywords": [
Expand All @@ -15,13 +15,13 @@
"international",
"libphonenumber"
],
"homepage": "https://github.com/devmehq/phonenumber-js#readme",
"homepage": "https://github.com/devmehq/phone-number-validator-js#readme",
"bugs": {
"url": "https://github.com/devmehq/phonenumber-js/issues"
"url": "https://github.com/devmehq/phone-number-validator-js/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/devmehq/phonenumber-js"
"url": "https://github.com/devmehq/phone-number-validator-js"
},
"license": "MIT",
"author": "DEV.ME <support@dev.me> (https://dev.me)",
Expand Down
2 changes: 1 addition & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* should probably include much more test cases
*/

import parsePhoneNumberFromString from 'libphonenumber-js'
import parsePhoneNumberFromString from 'libphone-number-validator-js'
import { geocoder, carrier, timezones } from './index'

it('geocodes with default locale en', async () => {
Expand Down
Loading

0 comments on commit 210aaef

Please sign in to comment.