Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

strip-indent

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-indent

Strip leading whitespace from every line in a string

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24M
decreased by-6.07%
Maintainers
1
Weekly downloads
 
Created

What is strip-indent?

The strip-indent npm package is used to remove the leading whitespace from every line in a given text block. This is particularly useful when working with multi-line strings that need to be displayed without indentation or when processing template literals in JavaScript that should not retain the formatting of the source code.

What are strip-indent's main functionalities?

Strip indentation from a multi-line string

This feature allows you to remove the common leading whitespace from all lines in a text block, making it easier to handle formatted multi-line strings without unwanted indentation.

const stripIndent = require('strip-indent');

const text = `    line one
        line two
    line three`;
console.log(stripIndent(text));

Other packages similar to strip-indent

Keywords

FAQs

Package last updated on 29 Mar 2014

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc