# lacuna-format

> Nodes utils.format but without appending extra arguments

Latest version **3.0.0** (published 2022-01-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install lacuna-format
pnpm add lacuna-format
yarn add lacuna-format
bun add lacuna-format
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-01-04 |
| First published | 2022-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kieran Simpson |
| Maintainers | kierans777 |
| Keywords | utils, format, formatting |

## Links

- npm: https://www.npmjs.com/package/lacuna-format
- Repository: https://github.com/kierans/lacuna-format
- Issues: https://github.com/kierans/lacuna-format/issues
- npm.io page: https://npm.io/package/lacuna-format

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2022-01-04
- 2.0.0 — 2022-01-04
- 1.0.0 — 2022-01-04

## README

# lacuna-format

Node's `util.format` but without appending extra arguments

## Usage

`lacuna-format` is a drop in replacement for Node's [formatting utility][1] where extra 
arguments are ignored.

```javascript
const { format } = require("lacuna-format");

format("This is a %s", "formatted message")
// "This is a formatted message
```

The difference is that unlike Node's built in `format`, `lacuna-format` **ignores** extra 
arguments. *lacunca* is a synonym for "ignored".

For example

```javascript
const { format } = require("util")
const { lacuna } = require("lacuna-format")

format("This is a message", undefined)
// This is a message undefined

lacuna("This is a message", undefined)
// This is a message
```

The rationale is that if you have a message with no format specifiers (eg: `%s`) then arguments
should not be interpolated/added to the resulting string.

# Known Issues

* When using `%s` with an object, `lacuna-format` will fail with a `ReferenceError` as 
  `getProxyDetails` is not exposed from the Node internals. Convert the object to a String 
  first, then pass to the formatter.

# Interoperability with Node

Each major version of `lucana-format` will track a LTS version of Node. The tests perform 
comparisons with the internal Node `util.format`.

* 1.x - Node JS 12.22.8
* 2.x - Node JS 14.18.2
* 3.x - Node JS 16.13.1

[1]: https://nodejs.org/docs/latest-v12.x/api/util.html#util_util_format_format_args

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