# bridge-utils

> simple interface for the logging-service

Latest version **0.0.6** (published 2022-05-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install bridge-utils
pnpm add bridge-utils
yarn add bridge-utils
bun add bridge-utils
```

## 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.6 |
| Published | 2022-05-09 |
| First published | 2022-05-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 5 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | Micheal Akinwonmi |
| Maintainers | michealhades |

## Links

- npm: https://www.npmjs.com/package/bridge-utils
- npm.io page: https://npm.io/package/bridge-utils

## Dependencies (5)

- [joi](https://npm.io/package/joi.md) ^17.6.0
- [axios](https://npm.io/package/axios.md) ^0.26.1
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [libphonenumber-js](https://npm.io/package/libphonenumber-js.md) ^1.9.52

## Recent versions

- 0.0.6 (latest) — 2022-05-09
- 0.0.5 — 2022-05-09
- 0.0.4 — 2022-05-09
- 0.0.3 — 2022-05-08
- 0.0.2 — 2022-05-04
- 0.0.1 — 2022-05-03

## README

bridge-utils
===========
bridge-utils - This is a utility package for reused component

## Installation
```json
"dependencies": {
  "bridge-utils": "^0.0.6" // see the "releases" section
}
```
```npm install tm-utils```
## Requirements
```javascript
const utils = require('bridge-utils');
```

### Phone Number Formatter (Single)
- To format a single phone number
```javascript
let phoneNumber = "08012345678";
phoneNumber = utils.helpers.formatPhoneNumber(phoneNumber, "NG");
console.log(phoneNumber); //2348012345678
```

### Phone Number Formatter (Multiple)
- To format an array of phone numbers
```javascript
let phoneNumbers = ["08012345678", "08012345679"];
phoneNumbers = utils.helpers.formatPhoneNumber(phoneNumbers, "NG");
console.log(phoneNumbers); //['2348012345678','2348012345679']
```

### Remove Empty Fields from Data
- To format an array of phone numbers
```javascript
let data = {
    "foo": "",
    "bar": "value"
};
data = utils.helpers.removeFieldsWithEmptyValue(data);
console.log(data); //{"bar":"value"}
```

### Logger
- Log data
```javascript
logger.error("This is an error from the package", {foo: "bar"}, new Error().stack);
logger.warn("This is an warning message from the package", {foo: "bar"}, new Error().stack);
logger.debug("This is an debug message from the package", {foo: "bar"}, new Error().stack);
logger.critical("This is a critical message from the package", {foo: "bar"}, new Error().stack);
logger.info("This is a info message from the package", {foo: "bar"}, new Error().stack);
logger.exception(new Error("Custom Error"), {foo: "bar"}, new Error().stack);

```

### Tests
#### Cli
```bash
npm install
npm test
```

#### Contributors

- [Micheal Akinwonmi](https://github.com/blackhades)
- [Ezeibe Sandra](https://github.com/sandysci)

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