Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

condense-whitespace

sindresorhus224kMIT3.0.0TypeScript support: included

Remove leading, trailing, and repeated whitespace from a string

whitespace, space, condense, collapse, compact, repeated, string, trim, remove, strip

readme

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'
  • trim-repeated - Trim a consecutively repeated substring: foo--bar---bazfoo-bar-baz