# @ministryofjustice/fb-utils-node

> Form Builder utilities

Latest version **0.1.8** (published 2019-11-21) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @ministryofjustice/fb-utils-node
pnpm add @ministryofjustice/fb-utils-node
yarn add @ministryofjustice/fb-utils-node
bun add @ministryofjustice/fb-utils-node
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2019-11-21 |
| First published | 2018-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Form Builder Team |
| Maintainers | adamsilver, asmega, elena_vi, emileswarts, form-builder-team, romidane, sequencemedialimited, solidgoldpig, stevemarshall, todderz, umaar, whatterz |

## Links

- npm: https://www.npmjs.com/package/@ministryofjustice/fb-utils-node
- Repository: https://github.com/ministryofjustice/fb-utils-node
- Homepage: https://github.com/ministryofjustice/fb-utils-node#readme
- Issues: https://github.com/ministryofjustice/fb-utils-node/issues
- npm.io page: https://npm.io/package/@ministryofjustice/fb-utils-node

## Dependencies (1)

- [sinon](https://npm.io/package/sinon.md) ^7.5.0

## Recent versions

- 0.1.8 (latest) — 2019-11-21
- 0.1.7 — 2019-10-28
- 0.1.6 — 2019-06-05
- 0.1.5 — 2019-03-04
- 0.1.4 — 2019-02-08
- 0.1.3 — 2018-11-27
- 0.1.2 — 2018-10-02
- 0.1.1 — 2018-06-26
- 0.1.0 — 2018-06-11
- 0.0.1 — 2018-06-11

## README

# fb-utils-node

Form Builder utility methods

## Installing

```sh
npm install @ministryofjustice/fb-utils-node
```

## Usage

```js
const FBUtils = require('@ministryofjustice/fb-utils-node')
```

## Methods

### logger

```js
FBUtils.logger(...args)
```

### clone

Returns a shallow copy of any object

```js
const clonedObj = FBUtils.clone(obj)
```

Objects can be of any type.

By default, the object copy is shallow.

To create a deep copy, pass `true`:

```js
const deeplyClonedObj = FBUtils.clone(obj, true)
```

### FBError

Base class for errors

```js
class MyError extends FBError {}

throw new MyError('An error occurred', {
  data: additionalData
})

```


## Testing

```sh
npm test
# Test output is in [TAP](https://testanything.org/) format
```

Run unit tests only

```sh
npm run test:unit
```

Run linting only

```sh
npm run lint
```

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