multilines
The missing template literal for NodeJS.
Last updated 8 months ago by maticzav .
MIT · Original npm · Tarball · package.json
$ cnpm install multilines 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.3                                ...           latest (8 months ago)

4 Versions

  • 1.0.3                                ...           8 months ago
  • 1.0.2                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (13)

Copyright 2014 - 2016 © taobao.org |