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

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.0.0
    242
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 3.0.0
    242
  • 2.0.0
    24,514
  • 1.0.0
    12,525

Package Sidebar

Install

npm i condense-whitespace

Weekly Downloads

37,281

Version

3.0.0

License

MIT

Unpacked Size

2.85 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus