Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

montag

coderaiser51.4kMIT1.2.1

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

tag, literal, join, template, array

readme

Montag License NPM version Dependency Status Build Status Coverage

“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.”

Format multiline strings using tagged templates, instead of puting all lines into an array and joining to a string.

Install

npm i montag

How to use?

const montag = require('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

changelog

2021.08.16, v1.2.1

fix:

  • (montag) one new line

feature:

  • (package) supertape v5.6.0
  • (package) eslint v8.0.0-beta.0
  • (package) eslint-plugin-putout v9.0.2
  • (package) putout v18.14.0

2021.01.21, v1.2.0

feature:

  • (package) putout v13.8.0
  • (montag) improve support of exotic spaced lines

2020.12.24, v1.1.0

feature:

  • (montag) add support of variables in template literals
  • (package) madrun v8.1.0
  • (package) eslint-plugin-putout v6.11.0
  • (package) putout v12.9.2
  • (package) supertape v4.1.0