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

Package Sidebar

Install

npm i condense-whitespace

Weekly Downloads

35,152

Version

3.0.0

License

MIT

Unpacked Size

2.85 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus