Skip to content

Commit

Permalink
Updated readme with fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bsteephenson committed Jun 28, 2015
1 parent 036a396 commit 31ae93f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -271,19 +271,19 @@ lines("Hello\nWorld");

#### wrap(str, options) => string

Splits a line `str` (default '') into several lines of size `options.width` (default 75) using a `options.seperator` (default '\n'). If `options.trailingSpaces` is true, make each line at least `width` long using trailing spaces. If `options.cut` is true, create new lines in the middle of words. If `options.trailingSpaces` is true, preserve the space that should be there at the end of a line.
Splits a line `str` (default '') into several lines of size `options.width` (default 75) using a `options.seperator` (default '\n'). If `options.trailingSpaces` is true, make each line at least `width` long using trailing spaces. If `options.cut` is true, create new lines in the middle of words. If `options.preserveSpaces` is true, preserve the space that should be there at the end of a line (only works if options.cut is false).

```javascript
wrap("Hello World", { width:5 })
// => "Hello\nWorld"

wrap("Hello World", { width:6, seperator:'.', cut:false, trailingSpaces: true })
wrap("Hello World", { width:6, seperator:'.', trailingSpaces: true })
// => "Hello .World "

wrap("Hello World", { width:5, seperator:'.', cut:true, trailingSpaces: true })
// => "Hello. Worl.d "

wrap("Hello World", { width:5, seperator:'.', cut:false, preserveSpaces: true })
wrap("Hello World", { width:5, seperator:'.', preserveSpaces: true })
// => "Hello .World"

```
Expand Down

0 comments on commit 31ae93f

Please sign in to comment.