Gathering detailed insights and metrics for angular-phone-utils-lib
Gathering detailed insights and metrics for angular-phone-utils-lib
Gathering detailed insights and metrics for angular-phone-utils-lib
Gathering detailed insights and metrics for angular-phone-utils-lib
Angular library for phone number formatting based on google-libphonenumber
npm install angular-phone-utils-lib
Typescript
Module System
Node Version
NPM Version
TypeScript (85.88%)
JavaScript (14.12%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
19 Commits
5 Branches
1 Contributors
Updated on Nov 20, 2021
Latest Version
0.1.3
Package Id
angular-phone-utils-lib@0.1.3
Unpacked Size
84.00 kB
Size
14.17 kB
File Count
29
NPM Version
6.14.8
Node Version
12.20.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
3
This an Angular library (and can be used with Angular projects only).
Since version 0.0.19, it is a wrapper arround google-libphonenumber for Angular. Because of the huge bundle size, from version 0.1.0 it was replaced by libphonenumber-js
npm install --save angular-phone-utils-lib
import { PhoneUtilsService } from 'angular-phone-utils-lib';
// Inject in your component or service:
constructor(private phoneUtils: PhoneUtilsService) { }
getInternational(value: string, country: string) - Transform a given phone number to international format
getNational(value: string, country: string) - Transform a given phone number to its national format
getPlain(value: string, country: string) - International format without inner spaces (PNF.E164)
isValid(value: string, country: string) - General purpose validator. Use in conjunction with other services and components. The method will return true when arguments relates to a phone number from the selected country.
isValidFormControl(country: string) - Reactive form validator. It will set phoneInvalid property in related form control error's object.
// app.component.ts
constructor(public phoneValidatorService: PhoneValidatorService) { }
public getForm() {
this.form = new FormGroup({
phone: new FormControl('', [
Validators.required,
this.phoneValidatorService.isValidPhone('BG')
])
});
}
// app.component.html
<span *ngIf="form.get('phone')?.errors?.phoneInvalid">{{ 'FORM.ERROR.PHONE_FORMAT.INVALID' | translate }}</span>
Import AngularPhoneUtilsLibModule in the module where you want to use it:
import { AngularPhoneUtilsLibModule } from 'angular-phone-utils-lib';
@NgModule({
imports: [
...,
AngularPhoneUtilsLibModule
]
})
export class UserModule() { }
And then it can be used as:
{{ '02 1234567' | internationalFormat : 'BG' }}
which will produce:
+359 2 123 4567
Import AngularPhoneUtilsLibModule in the module where you want to use it:
import { AngularPhoneUtilsLibModule } from 'angular-phone-utils-lib';
@NgModule({
imports: [
...,
AngularPhoneUtilsLibModule
]
})
export class UserModule() { }
And then it can be used as:
{{ '02 1234567' | nationalFormat : 'BG' }}
which will produce:
02 123 4567
npm run build:publish
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/18 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
117 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More