Skip to content

Attempt to create tags for template strings making them behave like coffee multiline strings

License

Notifications You must be signed in to change notification settings

endrin/multiline-tag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

multiline-tag

Module providing two tags for ES2015 template strings which allow to mimic behavior of CoffeeScript's Multiline and Block strings.

Install

$ npm install --save multiline-tag

Usage

var Multiline = require('multiline-tag').Multiline,
    Block = require('multiline-tag').Block;

var mobyDick = Multiline`
    Call me Ishmael. Some years ago --
    never mind how long precisely -- having little
    or no money in my purse, and nothing particular
    to interest me on shore, I thought I would sail
    about a little and see the watery part of the
    world...`;

console.dir(mobyDick);
// 'Call me Ishmael. Some years ago -- never mind how long precisely -- having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world...'

var html = Block`
      <strong>
        strong text is strong
      </strong>
    `;

console.dir(html);
// '<strong>\n  strong text is strong\n</strong>'

About

Attempt to create tags for template strings making them behave like coffee multiline strings

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published