multilines
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

If this package reaches anyone from NPM, please let me know if we could change the name to multilinestring.

multilines

npm version CircleCI codecov

The missing template literal for NodeJS.

Overview

multilines removes all spaces before | character and first space after if present.

  • 💅 Prettier code style: You no longer have to care about spaces in multiline strings!
  • 🌳 Zero dependencies: Completely self contained!
  • 💡 Inspired by Scala code style: Used by the best, now implemented for everyone.

Installation

yarn add multilines

Example

import mls from 'multilines'
 
// Before
 
function generate(...args) {
  const string = `
I have to start at the beggining of the line
so I don't break the string indentation.
  `
}
 
// After
 
function generate(...args) {
  const string = mls`
    | I can be aligned with other code
    | and everything still works as expected.
    `
}

License

MIT @ Matic Zavadlal

Readme

Keywords

none

Package Sidebar

Install

npm i multilines

Weekly Downloads

40

Version

1.0.3

License

MIT

Unpacked Size

9.12 kB

Total Files

9

Last publish

Collaborators

  • maticzav