Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ljqx/tager

A bunch of helpful tags for template strings.
https://github.com/ljqx/tager

template-literals template-string

Last synced: about 8 hours ago
JSON representation

A bunch of helpful tags for template strings.

Awesome Lists containing this project

README

        

# Tager
A bunch of helpful tags for [template strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals).

## Install
```
npm install tager
```
## API

### crlf => string

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

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

```js
lf`multi
line
string
`
// => 'multi\nline\nstring\n'
```
### lines => string[]

```js
lines`multi
line
string
`;
// => ['multi', 'line', 'string', '']
```
### regexp => RegExp

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