# format-message-print

> Pretty print compact message format ast

Latest version **6.2.4** (published 2022-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install format-message-print
pnpm add format-message-print
yarn add format-message-print
bun add format-message-print
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.2.4 |
| Published | 2022-02-17 |
| First published | 2015-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 206 |
| Author | Andy VanWagoner |
| Maintainers | thetalecrafter, bjohn465, aaronshaf, brentburgoyne |
| Keywords | format-message |

## Links

- npm: https://www.npmjs.com/package/format-message-print
- Repository: https://github.com/format-message/format-message
- Homepage: https://github.com/format-message/format-message/tree/master/packages/format-message-print
- Issues: https://github.com/format-message/format-message/issues
- npm.io page: https://npm.io/package/format-message-print

## 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

- 6.2.4 (latest) — 2022-02-17
- 6.0.0-alpha.2 (next) — 2018-04-18
- 6.2.3 — 2019-07-04
- 6.2.2 — 2019-07-04
- 6.2.0 — 2018-09-12
- 6.1.0 — 2018-08-30
- 6.0.4 — 2018-06-05
- 6.0.3 — 2018-04-27
- 6.0.2 — 2018-04-23
- 6.0.0 — 2018-04-19
- 6.0.0-alpha.1 — 2018-04-17
- 6.0.0-alpha.0 — 2018-04-16
- 5.1.2 — 2017-03-23
- 5.1.0 — 2016-12-28
- 5.0.0 — 2016-09-27
- … 5 more at https://npm.io/package/format-message-print/versions

## README

# ![format-message-print][logo]

> Pretty print compact message format ast

[![npm Version][npm-image]][npm]
[![JS Standard Style][style-image]][style]
[![MIT License][license-image]][LICENSE]


Turns a compact format-message ast:
```js
[ "You have ", [ "numBananas", "plural", 0, {
     "=0": [ "no bananas" ],
    "one": [ "a banana" ],
  "other": [ [ '#' ], " bananas" ]
} ], " for sale." ]
```

into a pretty ICU Message Format string:
```js
`You have {
  numBananas, plural,
     =0 {no bananas}
    one {a banana}
  other {# bananas}
} for sale`
```


Quick Examples
--------------

`npm install format-message-print --save`

```js
import parse from 'format-message-parse'
import print from 'format-message-print'

print(parse('Hello, {name}!'))
//-> 'Hello { name }!'
```

API
---

### `print(pattern)`

Generate a string from an ast. The output is a canonical version of the pattern.


License
-------

This software is free to use under the MIT license. See the [LICENSE-MIT file][LICENSE] for license text and copyright information.


[logo]: https://format-message.github.io/format-message/logo.svg
[npm]: https://www.npmjs.org/package/format-message-print
[npm-image]: https://img.shields.io/npm/v/format-message-print.svg
[style]: https://github.com/feross/standard
[style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
[license-image]: https://img.shields.io/npm/l/format-message.svg
[LICENSE]: https://github.com/format-message/format-message/blob/master/LICENSE-MIT

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