tsheredoc
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

tsheredoc

NPM version Build Status semantic-release

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    364
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    364
  • 1.0.0
    0

Package Sidebar

Install

npm i tsheredoc

Weekly Downloads

253

Version

1.0.1

License

MIT

Unpacked Size

6.16 kB

Total Files

5

Last publish

Collaborators

  • jwalton