# montag

> format multiline strings using tagged templates, instead of putting all lines into an array and joining to a string

Latest version **2.0.2** (published 2026-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install montag
pnpm add montag
yarn add montag
bun add montag
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2026-09-09 |
| First published | 2020-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | tag, literal, join, template, array |

## Links

- npm: https://www.npmjs.com/package/montag
- Repository: https://github.com/coderaiser/montag
- Issues: https://github.com/coderaiser/montag/issues
- npm.io page: https://npm.io/package/montag

## Alternatives

- [@lexical/table](https://npm.io/package/@lexical/table.md) — 3.0M weekly downloads
- [mantine-datatable](https://npm.io/package/mantine-datatable.md) — 98.2K weekly downloads
- [react-native-collapsible-tab-view](https://npm.io/package/react-native-collapsible-tab-view.md) — 70.6K weekly downloads
- [@handsontable/vue3](https://npm.io/package/@handsontable/vue3.md) — 16.1K weekly downloads
- [vuewordcloud](https://npm.io/package/vuewordcloud.md) — 7.2K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2026-09-09
- 2.0.1 — 2026-04-21
- 2.0.0 — 2026-04-21
- 1.2.1 — 2021-08-16
- 1.2.0 — 2021-01-21
- 1.1.0 — 2020-12-24
- 1.0.0 — 2020-05-07

## README

# Montag [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage][CoverageIMGURL]][CoverageURL]

> “If you don’t want a house built, hide the nails and wood.
> If you don’t want a man unhappy politically, don’t give him two sides to a question to worry him; give him one. Better yet, give him none.”
>
> (c) Ray Bradbury "Fahrenheit 451"

Format multiline strings using [tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates), instead of putting all lines into an array and joining to a string. Use [@putout/plugin-montag](https://github.com/coderaiser/putout/tree/master/packages/plugin-montag) to convert existing code to `montag`.

## Install

```
npm i montag
```

## How to use?

```js
import {montag} from 'montag';

const str1 = montag`
    if (a > b)
        console.log(c);
`;

const str2 = [
    'if (a > b)',
    '    console.log(c)',
].join('\n');

str1 === str2;
// returns
true;
```

## License

MIT

[NPMIMGURL]: https://img.shields.io/npm/v/montag.svg?style=flat&longCache=true
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/montag/master.svg?style=flat&longCache=true
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/montag "npm"
[BuildStatusURL]: https://travis-ci.org/coderaiser/montag "Build Status"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[CoverageURL]: https://coveralls.io/github/coderaiser/montag?branch=master
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/montag/badge.svg?branch=master&service=github

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