🚀 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 - npm Package Compare versions

Comparing version
1.0.0
to
1.0.1
+7
LICENSE.md
Copyright 2021 Leonardo Raele
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# mlstr
[![](https://img.shields.io/npm/v/mlstr)](https://npmjs.com/package/mlstr)
Zero-dependency multiline string template.
## Intallation
npm install mlstr
or
yarn add mlstr
## Usage
First, `import` or `require` the lib:
```js
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:**
```js
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](/license.txt) file for details)
+6
-2
{
"name": "mlstr",
"version": "1.0.0",
"description": "Multiline template string",
"version": "1.0.1",
"description": "Zero-dependency multiline template string",
"main": "index.js",

@@ -9,2 +9,6 @@ "scripts": {

},
"repository": {
"type": "git",
"url": "https://github.com/leonardoraele/mlstr.git"
},
"keywords": [

@@ -11,0 +15,0 @@ "mlstr",