Skip to content

Commit

Permalink
Refactor readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jun 25, 2017
1 parent 7151bde commit 9f7f92a
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions readme.md
Expand Up @@ -12,37 +12,17 @@ npm install collapse-white-space

## Usage

Dependencies.

```javascript
var collapse = require('collapse-white-space');
```

Collapse white space:

```javascript
var result = collapse('\tfoo \n\tbar \t\r\nbaz');
```

Yields:

```text
foo bar baz
collapse('\tfoo \n\tbar \t\r\nbaz'); //=> ' foo bar baz'
```

## API

### `collapse(value)`

Replace multiple white-space characters with a single space.

###### Parameters

* `value` (`string`) — Value with uncollapsed white-space, coerced to string.

###### Returns

`string` — Value with collapsed white-space.
Replace multiple white-space characters in value with a single space.

## License

Expand Down

0 comments on commit 9f7f92a

Please sign in to comment.