# quick-format-unescaped

> Solves a problem with util.format

Latest version **4.0.4** (published 2021-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install quick-format-unescaped
pnpm add quick-format-unescaped
yarn add quick-format-unescaped
bun add quick-format-unescaped
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.4 |
| Published | 2021-09-21 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/quick-format-unescaped) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | David Mark Clements |
| Maintainers | davidmarkclements |

## Links

- npm: https://www.npmjs.com/package/quick-format-unescaped
- Repository: https://github.com/davidmarkclements/quick-format
- Homepage: https://github.com/davidmarkclements/quick-format#readme
- Issues: https://github.com/davidmarkclements/quick-format/issues
- npm.io page: https://npm.io/package/quick-format-unescaped

## Recent versions

- 4.0.4 (latest) — 2021-09-21
- 4.0.3 — 2021-03-12
- 4.0.2 — 2021-03-10
- 4.0.1 — 2020-03-23
- 4.0.0 — 2020-03-23
- 3.0.3 — 2019-09-30
- 3.0.2 — 2019-02-05
- 3.0.1 — 2018-11-01
- 3.0.0 — 2018-06-12
- 2.0.1 — 2018-05-29
- 2.0.0 — 2018-05-28
- 1.1.2 — 2018-01-18
- 1.1.1 — 2017-03-29
- 1.1.0 — 2017-03-13
- 1.0.0 — 2016-11-15

## README

# quick-format-unescaped

## unescaped ?

Sometimes you want to embed the results of quick-format into another string, 
and then escape the whole string. 

## usage

```js
var format = require('quick-format-unescaped')
format('hello %s %j %d', ['world', [{obj: true}, 4, {another: 'obj'}]])
```

## format(fmt, parameters, [options])

### fmt

A `printf`-like format string. Example: `'hello %s %j %d'`

### parameters

Array of values to be inserted into the `format` string. Example: `['world', {obj:true}]`

### options.stringify

Passing an options object as the third parameter with a `stringify` will mean 
any objects will be passed to the supplied function instead of an the 
internal `tryStringify` function. This can be useful when using augmented
capability serializers such as [`fast-safe-stringify`](http://github.com/davidmarkclements/fast-safe-stringify) or [`fast-redact`](http://github.com/davidmarkclements/fast-redact).  

## caveats

By default `quick-format-unescaped` uses  `JSON.stringify` instead of `util.inspect`, this means functions *will not be serialized*.

## Benchmarks

### Node 8.11.2

```
util*100000: 350.325ms
quick*100000: 268.141ms
utilWithTailObj*100000: 586.387ms
quickWithTailObj*100000: 280.200ms
util*100000: 325.735ms
quick*100000: 270.251ms
utilWithTailObj*100000: 492.270ms
quickWithTailObj*100000: 261.797ms
```

### Node 10.4.0

```
util*100000: 301.035ms
quick*100000: 217.005ms
utilWithTailObj*100000: 404.778ms
quickWithTailObj*100000: 236.176ms
util*100000: 286.349ms
quick*100000: 214.646ms
utilWithTailObj*100000: 388.574ms
quickWithTailObj*100000: 226.036ms
```

## Acknowledgements

Sponsored by [nearForm](http://www.nearform.com)

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