endent
endent copied to clipboard
⬅️ An ES6 string tag makes indentation better
I created this PR instead of opening an issue, because I thought it would be easier to describe and understand. So this is not a PR submitted for merging, but...
Currently endent trims all start and end newlines. But it would be more flexible to only trim max 1 newline. This way we can create newlines in the template string....
If I do this: ```js console.log(endent` hello \`\`\`json ${endent.pretty({ a: 1, b: 2, c: { foo: 3, bar: 4 } })} \`\`\` world `) ``` Or this: ```js const myJson...
When i run ```js import endent from 'endent'; console.log(endent); ``` It will output `{ default: [Function: endent] { pretty: [Function (anonymous)] } }` instead of just `[Function: endent] { pretty:...
There are build errors. Upgrading TypeScript fixes them.