montag
format multiline strings using tagged templates, instead of putting all lines into an array and joining to a string
Last updated 2 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install montag 
SYNC missed versions from official npm registry.

Montag License NPM version 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.”

(c) Ray Bradbury "Fahrenheit 451"

Format multiline strings using tagged templates, instead of putting all lines into an array and joining to a string. Use @putout/plugin-montag to convert existing code to montag.

Install

npm i montag

How to use?

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

Current Tags

  • 2.0.3                                ...           latest (2 months ago)

8 Versions

  • 2.0.3                                ...           2 months ago
  • 2.0.2                                ...           3 months ago
  • 2.0.1                                ...           7 months ago
  • 2.0.0                                ...           7 months ago
  • 1.2.1                                ...           5 years ago
  • 1.2.0                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 25
Today 0
This Week 8
This Month 17
Last Day 0
Last Week 0
Last Month 5
Dependencies (0)
None
Dev Dependencies (8)

© 2010 - cnpmjs.org x YWFE | Home | YWFE