strip-indent (4.0.0)

Published 2026-02-24 14:05:47 +00:00 by atheaadmin

Installation

registry=
npm install strip-indent@4.0.0
"strip-indent": "4.0.0"

About this package

strip-indent

Strip leading whitespace from each 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 strip-indent

Usage

import stripIndent from 'strip-indent';

const string = '\tunicorn\n\t\tcake';
/*
	unicorn
		cake
*/

stripIndent(string);
/*
unicorn
	cake
*/

Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Dependencies

Dependencies

ID Version
min-indent ^1.0.1

Development Dependencies

ID Version
ava ^3.15.0
tsd ^0.14.0
xo ^0.39.1

Keywords

strip indent indentation normalize remove delete whitespace space tab string
Details
npm
2026-02-24 14:05:47 +00:00
0
Sindre Sorhus
MIT
latest
1.8 KiB
Assets (1)
Versions (2) View all
4.0.0 2026-02-24
3.0.0 2026-02-24