condense-whitespace
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

condense-whitespace

Remove leading, trailing, and repeated whitespace from a string

Install

$ npm install condense-whitespace

Usage

import condenseWhitespace from 'condense-whitespace';

condenseWhitespace('  foo bar     baz ');
//=> 'foo bar baz'

Related

  • trim-repeated - Trim a consecutively repeated substring: foo--bar---bazfoo-bar-baz

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.0.0139latest

Version History

VersionDownloads (Last 7 Days)Published
3.0.0139
2.0.039,316
1.0.014,516

Package Sidebar

Install

npm i condense-whitespace

Weekly Downloads

53,971

Version

3.0.0

License

MIT

Unpacked Size

2.85 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus