You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -47,12 +44,11 @@ The width of the text before wrapping to a new line.
47
44
wrap(str, {width:60});
48
45
```
49
46
50
-
51
47
### options.indent
52
48
53
49
Type: `String`
54
50
55
-
Default: `` (two spaces)
51
+
Default: `` (two spaces)
56
52
57
53
The string to use at the beginning of each line.
58
54
@@ -62,7 +58,6 @@ The string to use at the beginning of each line.
62
58
wrap(str, {indent:''});
63
59
```
64
60
65
-
66
61
### options.newline
67
62
68
63
Type: `String`
@@ -77,7 +72,6 @@ The string to use at the end of each line.
77
72
wrap(str, {newline:'\n\n'});
78
73
```
79
74
80
-
81
75
### options.trim
82
76
83
77
Type: `Boolean`
@@ -92,50 +86,51 @@ Trim trailing whitespace from the returned string. This option is included since
92
86
wrap(str, {trim:true});
93
87
```
94
88
95
-
96
89
### options.cut
97
90
98
91
Type: `Boolean`
99
92
100
93
Default: `false`
101
94
102
-
The string is always wrapped at the specified width. So if you have a word that is larger than the given width, it is broken apart.
95
+
Break a word between any two letters when the word is longer than the specified width.
103
96
104
97
**Example:**
105
98
106
99
```js
107
100
wrap(str, {cut:true});
108
101
```
109
102
110
-
111
103
## Related projects
112
-
*[wordcount](https://github.com/jonschlinkert/wordcount): Count the words in string. Has basic support for Cyrillic and CJK.
113
-
*[unique-words](https://github.com/jonschlinkert/unique-words): Return the unique words in a string or array.
114
-
*[common-words](https://github.com/jonschlinkert/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.
115
-
*[shuffle-words](https://github.com/jonschlinkert/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.
104
+
105
+
*[common-words](https://github.com/jonschlinkert/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words)
106
+
*[shuffle-words](https://github.com/jonschlinkert/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words)
107
+
*[unique-words](https://github.com/jonschlinkert/unique-words): Return the unique words in a string or array.
108
+
*[wordcount](https://github.com/jonschlinkert/wordcount): Count the words in string. Has basic support for Cyrillic and CJK.
116
109
117
110
## Running tests
111
+
118
112
Install dev dependencies:
119
113
120
-
```bash
121
-
npm i -d && npm test
114
+
```sh
115
+
$ npm i -d && npm test
122
116
```
123
117
124
118
## Contributing
125
-
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/word-wrap/issues)
119
+
120
+
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/word-wrap/issues/new)
0 commit comments