🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

mlstr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mlstr

Zero-dependency multiline template string

latest
Source
npmnpm
Version
1.0.3
Version published
Weekly downloads
3
-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

mlstr

Zero-dependency multiline string template.

Intallation

npm install mlstr

or

yarn add mlstr

Usage

First, import or require the lib:

const mlstr = require('mlstr');

// or

import mlstr from 'mlstr';

Then just add the mlstr tag in front of a string template with multiple lines to compact it into a plain string. Line breaks in the string template are replaced by spaces.

Example:

const mystring = mlstr`
        The string can have many
        lines but the output will
        be plain text.

        Leave one line empty to
        create actual line breaks
        in the string output.
        (similar to markdown)
    `;

console.log(mystring);

The code above outputs this:

The string can have many lines but the output will be plain text.
Leave one line empty to create actual line breaks in the string output. (similar to markdown)

LICENSE

MIT (see LICENSE.md file for details)

Keywords

mlstr

FAQs

Package last updated on 03 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts