heredoc-tag
Heredoc helpers for ES2015 template strings
Installation
npm install heredoc-tag
Examples
(Taken from the examples file)
;let str; // Trimstr = heredoctrim` this is a test `;console; // "this is a test" // Remove newlinesstr = heredoconeline` Here is a sentence split across multiple lines.`;console; // " Here is a sentence split across multiple lines." // Remove newlines, trim each line, then join lines with a spacestr = heredoconelinetrim` Here is a sentence split across multiple lines.`;console; // "Here is a sentence split across multiple lines." // Unindent as far as possiblestr = heredocunindent` This is an example where some text is indented more and some text is indented less for whatever reason.`;console;// "// This is an example// where some text is indented more// and some text is indented less// for whatever reason.// " // Unindent, trim the ends of lines, trim leading/trailing whitespacestr = heredocunindenttrim` This is an example where some text is indented more and some text is indented less for whatever reason.`;console;// " This is an example// where some text is indented more// and some text is indented less// for whatever reason."