Socket
Socket
Sign inDemoInstall

strip-indent

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    strip-indent

Strip leading whitespace from every line in a string


Version published
Weekly downloads
23M
decreased by-9.88%
Maintainers
1
Install size
7.69 kB
Created
Weekly downloads
 

Readme

Source

strip-indent Build Status

Strip leading whitespace from every line in a string

The line with the least number of leading whitespace, ignoring empty lines, determines the number to remove.

Useful for removing redundant indentation.

Install

$ npm install --save strip-indent

Usage

var str = '\tunicorn\n\t\tcake';
/*
	unicorn
		cake
*/

stripIndent('\tunicorn\n\t\tcake');
/*
unicorn
	cake
*/

CLI

$ npm install --global strip-indent
$ strip-indent --help

  Usage
    strip-indent <file>
    echo <string> | strip-indent

  Example
    echo '\tunicorn\n\t\tcake' | strip-indent
    unicorn
    	cake
  • indent-string - Indent each line in a string

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 16 Feb 2015

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