strip-indent (3.0.0)

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

Installation

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

About this package

strip-indent Build Status

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

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

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

stripIndent(string);
/*
unicorn
	cake
*/

License

MIT © Sindre Sorhus

Dependencies

Dependencies

ID Version
min-indent ^1.0.0

Development Dependencies

ID Version
ava ^1.4.1
tsd ^0.7.2
xo ^0.24.0

Keywords

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