Socket
Socket
Sign inDemoInstall

one-liner

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    one-liner

Transform a string to a one line string by converting and merging line breaks/carriages, tabs, spaces


Version published
Weekly downloads
1.2K
increased by2.9%
Maintainers
1
Install size
3.64 kB
Created
Weekly downloads
 

Readme

Source

one-liner Build Status

Transform a string to a one line string by converting and merging line breaks/carriages, tabs, spaces.

Why

If you want to display some strings in the console that could have potentially have spaces, line breaks etc. that are not really important.

Install

$ npm install --save one-liner

Usage

var oneliner = require('oneliner')

var oneline = oneliner(`Hey !
  This is my text file
  with a lot of blabla and some code:
    function t(a, b) {
      return a + b;
    }`)

console.log(oneline)
// Hey ! This is my text file with a lot of blabla and some code: function t(a, b) { return a + b; }

It also support template literals:

oneliner`This is amazing.
         It truly is phenomenal
         based on what they say`

It replaces and collapses \t\r\n and spaces.

Keywords

FAQs

Last updated on 15 Feb 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc