Package Exports
- js-trim-multiline-string
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js-trim-multiline-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
js-trim-multiline-string 
multiline strings are a pain in javascript.
the most readable multiline string is as follows:
Expected Result:
"
this
is
a
multiline
string
"
Before:
def multilineStringExample() {
const stringConcatenation = '' +
'this ' +
'is' +
'a' +
'multiline' +
'string' +
'';
return stringConcatenation;
}
After:
def multilineStringExample() {
const taggedTemplate = mtrim `
this
is
a
multiline
string
`
return taggedTemplate
}
Install
$ npm install --save trim-multiline-string
FullUsage, (Use the library as a Function, Tagged Template, Prototype Function), If Indent present keep Indent.!
const { mtrim } = require('trim-multiline-string');
console.log(
mtrim(str),
mtrim(`str`),
mtrim`
check it out!
`,
mtrim
`check it out!`,
`str`.mtrim()
`
Keep Indent
Implementation
By Passing Number!
`.mtrim(3)
)
Related
multiline
- Multiline string using anonymous function, and function call.trim-newlines
- Similar toString#trim()
but removes only newlinestrim-right
- Similar toString#trim()
but removes only whitespace on the righttrim-off-newlines
- Similar toString#trim()
but removes only newlines
License
MIT © michael_dimmitt
Projects Using mtrim:
https://github.com/MichaelDimmitt/simp-js_term/blob/master/terminal.test.js