@jondotsoy/unindent
v0.1.1
Published
remove origin's indentation
Downloads
5
Readme
unindent
Remove origin's indentation.
Samples:
// Remove indentation from a text with 2 spaces.
const script = unindent`
param:
second_params: 3
`; // => "param:\n second_params: 3\n"
// Change indentation to 4 spaces
const script = unindent(4)`
param:
second_params: 3
`; // => " param:\n second_params: 3\n"
Syntax
unindent`text multiline`; // => string
unindent(indentSize)`text multiline`; // => string
unindent(textMultiline); // => string
unindent(indentSize, textMultiline); // => string
Parameters
text multiline
: Can be used theunindent
function as a tagged template.indentSize
(number): define the new indentation to the text.textMultiline
(string): text to remove indentation
Return value
A string formatted.