Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 21, 2024 via pnpm

strip-indent 3.0.0

Strip leading whitespace from each line in a string
Package summary
Share
0
issues
1
license
2
MIT
Package created
29 Mar 2014
Version published
17 Apr 2019
Maintainers
1
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
min-indent@1.0.1
strip-indent@3.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of strip-indent 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
min-indent1.0.11.62 kBMIT
prod

Visualizations

Frequently Asked Questions

What does strip-indent do?

Strip-indent is a highly useful npm package that allows you to remove leading whitespace from each line in a string. The line with the smallest number of leading whitespaces, ignoring lines that are totally empty, determines the exact number of spaces to take out. It's especially beneficial when you need to get rid of redundant indentation in your strings.

How do you use strip-indent?

Utilizing strip-indent in your code is a straightforward task. First, you need to install the npm package by running npm install strip-indent`` in your terminal. Once it's installed, you can import it into your JavaScript file usingimport stripIndent from 'strip-indent';```. Now, to strip indentation from a string, call the stripIndent function with the string you want to operate on as the argument. For example:

import stripIndent from 'strip-indent';

const string = '\tunicorn\n\t\tcake';   // this is the original string with indentation
/*
	unicorn
		cake
*/

stripIndent(string);   // the indentation is stripped here
/*
unicorn
	cake
*/

In this example, '\tunicorn\n\t\tcake' is the string we initially have. After running the stripIndent function on this string, you're left with a new formatted string where redundant indentation has been stripped out.

Where are the strip-indent docs?

The comprehensive documentation for strip-indent is readily accessible on its GitHub repository at https://github.com/sindresorhus/strip-indent.git. Here, you can explore details about the installation and usage procedures, its functionalities, and related packages. You can also find resources to gain professional support with a Tidelift subscription.