Skip to content

ES2015+ template literal utilities under the form of tags.

License

Notifications You must be signed in to change notification settings

mathieumg/tempura

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DEPRECATED: This package has been deprecated in favor of common-tags.

tempura

npm version Build Status Dependency Status devDependency Status

Template literal utilities under the form of tags

Usage

noMultiSpaceAfterLineFeed

Utility to write template literals without having to worry about whitespace after newline feeds and before text, and newline feeds.

import {noMultiSpaceAfterLineFeed} from 'tempura';

const myMultilineString = noMultiSpaceAfterLineFeed`
   My Super String
   That is well indented.
`;

console.log(myMultilineString);

/* Outputs the following
My Super String
That is well indentend
*/

noMultiLine

Utility to remove all newline characters from a template literal.

import {noMultiLine} from 'tempura';

const myMultilineString = noMultiLine`
expression that should

be on a single line
but is multilined for line length
`;

console.log(myMultilineString);

/* Outputs the following
expression that shouldbe on a single linebut is multilined for line length
*/

noWhitespace

Utility to remove all whitespace in template literals.

import {noWhitespace} from 'tempura';

const myStringWithWhiteSpace = noWhitespace`
expression that shouldn't have whitespace in it,
but has some for clarity in code
`;

console.log(myStringWithWhiteSpace);

/* Outputs the following
expressionthatshouldn'thavewhitespaceinit,buthassomeforclarityincode
*/

About

ES2015+ template literal utilities under the form of tags.

Resources

License

Stars

Watchers

Forks

Packages

No packages published