/tager

A bunch of helpful tags for template strings.

Primary LanguageJavaScriptMIT LicenseMIT

Tager

A bunch of helpful tags for template strings.

Install

npm install tager

API

crlf => string

crlf`multi
line
string
`
// => 'multi\r\nline\r\nstring\r\n'

identity => string

identity`${1} template string`
// => 1 template string
// same as `${1} template string`

lf => string

lf`multi
line
string
`
// => 'multi\nline\nstring\n'

lines => string[]

lines`multi
line
string
`;
// => ['multi', 'line', 'string', '']

regexp => RegExp

regexp`\w+${1 + 1}*\node_modules/${'.bin'}`;
// => /\w+2*\node_modules\/.bin/