solidsnack / tsheredoc

Heredocs for javascript and typescript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tsheredoc

NPM version Build Status

What is it?

This makes is so you can generate multi-line strings without messing up your indents in Javascript/Typescript:

import heredoc from 'tsheredoc';

const usage = heredoc`
   Usage: mycommand [arguments]
   Does cool stuff.
`;
// Usage will be "Usage: mycommand [arguments]\nDoes cool stuff.\n"

This can be used either as a template string (as above) or as a function:

import heredoc from 'tsheredoc';

const usage = heredoc(`
   Usage: mycommand [arguments]
   Does cool stuff.
`;
// Same as above

About

Heredocs for javascript and typescript.


Languages

Language:TypeScript 76.7%Language:JavaScript 23.3%