condense-whitespace
v3.0.0 whitespace space condense collapse compact repeated string trim remove and 2 more...
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---baz
→foo-bar-baz
npm i condense-whitespace
Metadata
- MIT
- ^12.20.0 || ^14.13.1 || >=16.0.0
- Sindre Sorhus
- released 8/10/2021