mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-13 05:13:33 -06:00
Initial commit
This commit is contained in:
168
node_modules/wrap-ansi/index.js
generated
vendored
Executable file
168
node_modules/wrap-ansi/index.js
generated
vendored
Executable file
@@ -0,0 +1,168 @@
|
||||
'use strict';
|
||||
var stringWidth = require('string-width');
|
||||
var stripAnsi = require('strip-ansi');
|
||||
|
||||
var ESCAPES = [
|
||||
'\u001b',
|
||||
'\u009b'
|
||||
];
|
||||
|
||||
var END_CODE = 39;
|
||||
|
||||
var ESCAPE_CODES = {
|
||||
0: 0,
|
||||
1: 22,
|
||||
2: 22,
|
||||
3: 23,
|
||||
4: 24,
|
||||
7: 27,
|
||||
8: 28,
|
||||
9: 29,
|
||||
30: 39,
|
||||
31: 39,
|
||||
32: 39,
|
||||
33: 39,
|
||||
34: 39,
|
||||
35: 39,
|
||||
36: 39,
|
||||
37: 39,
|
||||
90: 39,
|
||||
40: 49,
|
||||
41: 49,
|
||||
42: 49,
|
||||
43: 49,
|
||||
44: 49,
|
||||
45: 49,
|
||||
46: 49,
|
||||
47: 49
|
||||
};
|
||||
|
||||
function wrapAnsi(code) {
|
||||
return ESCAPES[0] + '[' + code + 'm';
|
||||
}
|
||||
|
||||
// calculate the length of words split on ' ', ignoring
|
||||
// the extra characters added by ansi escape codes.
|
||||
function wordLengths(str) {
|
||||
return str.split(' ').map(function (s) {
|
||||
return stringWidth(s);
|
||||
});
|
||||
}
|
||||
|
||||
// wrap a long word across multiple rows.
|
||||
// ansi escape codes do not count towards length.
|
||||
function wrapWord(rows, word, cols) {
|
||||
var insideEscape = false;
|
||||
var visible = stripAnsi(rows[rows.length - 1]).length;
|
||||
|
||||
for (var i = 0; i < word.length; i++) {
|
||||
var x = word[i];
|
||||
|
||||
rows[rows.length - 1] += x;
|
||||
|
||||
if (ESCAPES.indexOf(x) !== -1) {
|
||||
insideEscape = true;
|
||||
} else if (insideEscape && x === 'm') {
|
||||
insideEscape = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (insideEscape) {
|
||||
continue;
|
||||
}
|
||||
|
||||
visible++;
|
||||
|
||||
if (visible >= cols && i < word.length - 1) {
|
||||
rows.push('');
|
||||
visible = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// it's possible that the last row we copy over is only
|
||||
// ansi escape characters, handle this edge-case.
|
||||
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
||||
rows[rows.length - 2] += rows.pop();
|
||||
}
|
||||
}
|
||||
|
||||
// the wrap-ansi module can be invoked
|
||||
// in either 'hard' or 'soft' wrap mode.
|
||||
//
|
||||
// 'hard' will never allow a string to take up more
|
||||
// than cols characters.
|
||||
//
|
||||
// 'soft' allows long words to expand past the column length.
|
||||
function exec(str, cols, opts) {
|
||||
var options = opts || {};
|
||||
|
||||
var pre = '';
|
||||
var ret = '';
|
||||
var escapeCode;
|
||||
|
||||
var lengths = wordLengths(str);
|
||||
var words = str.split(' ');
|
||||
var rows = [''];
|
||||
|
||||
for (var i = 0, word; (word = words[i]) !== undefined; i++) {
|
||||
var rowLength = stringWidth(rows[rows.length - 1]);
|
||||
|
||||
if (rowLength) {
|
||||
rows[rows.length - 1] += ' ';
|
||||
rowLength++;
|
||||
}
|
||||
|
||||
// in 'hard' wrap mode, the length of a line is
|
||||
// never allowed to extend past 'cols'.
|
||||
if (lengths[i] > cols && options.hard) {
|
||||
if (rowLength) {
|
||||
rows.push('');
|
||||
}
|
||||
wrapWord(rows, word, cols);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rowLength + lengths[i] > cols && rowLength > 0) {
|
||||
if (options.wordWrap === false && rowLength < cols) {
|
||||
wrapWord(rows, word, cols);
|
||||
continue;
|
||||
}
|
||||
|
||||
rows.push('');
|
||||
}
|
||||
|
||||
rows[rows.length - 1] += word;
|
||||
}
|
||||
|
||||
pre = rows.map(function (r) {
|
||||
return r.trim();
|
||||
}).join('\n');
|
||||
|
||||
for (var j = 0; j < pre.length; j++) {
|
||||
var y = pre[j];
|
||||
|
||||
ret += y;
|
||||
|
||||
if (ESCAPES.indexOf(y) !== -1) {
|
||||
var code = parseFloat(/[0-9][^m]*/.exec(pre.slice(j, j + 4)));
|
||||
escapeCode = code === END_CODE ? null : code;
|
||||
}
|
||||
|
||||
if (escapeCode && ESCAPE_CODES[escapeCode]) {
|
||||
if (pre[j + 1] === '\n') {
|
||||
ret += wrapAnsi(ESCAPE_CODES[escapeCode]);
|
||||
} else if (y === '\n') {
|
||||
ret += wrapAnsi(escapeCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// for each line break, invoke the method separately.
|
||||
module.exports = function (str, cols, opts) {
|
||||
return String(str).split('\n').map(function (substr) {
|
||||
return exec(substr, cols, opts);
|
||||
}).join('\n');
|
||||
};
|
21
node_modules/wrap-ansi/license
generated
vendored
Normal file
21
node_modules/wrap-ansi/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
37
node_modules/wrap-ansi/node_modules/string-width/index.js
generated
vendored
Normal file
37
node_modules/wrap-ansi/node_modules/string-width/index.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
var stripAnsi = require('strip-ansi');
|
||||
var codePointAt = require('code-point-at');
|
||||
var isFullwidthCodePoint = require('is-fullwidth-code-point');
|
||||
|
||||
// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
|
||||
module.exports = function (str) {
|
||||
if (typeof str !== 'string' || str.length === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var width = 0;
|
||||
|
||||
str = stripAnsi(str);
|
||||
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var code = codePointAt(str, i);
|
||||
|
||||
// ignore control characters
|
||||
if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// surrogates
|
||||
if (code >= 0x10000) {
|
||||
i++;
|
||||
}
|
||||
|
||||
if (isFullwidthCodePoint(code)) {
|
||||
width += 2;
|
||||
} else {
|
||||
width++;
|
||||
}
|
||||
}
|
||||
|
||||
return width;
|
||||
};
|
21
node_modules/wrap-ansi/node_modules/string-width/license
generated
vendored
Normal file
21
node_modules/wrap-ansi/node_modules/string-width/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
115
node_modules/wrap-ansi/node_modules/string-width/package.json
generated
vendored
Normal file
115
node_modules/wrap-ansi/node_modules/string-width/package.json
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"string-width@^1.0.1",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/wrap-ansi"
|
||||
]
|
||||
],
|
||||
"_from": "string-width@>=1.0.1 <2.0.0",
|
||||
"_id": "string-width@1.0.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/wrap-ansi/string-width",
|
||||
"_nodeVersion": "4.4.5",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-12-west.internal.npmjs.com",
|
||||
"tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "2.15.5",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "string-width",
|
||||
"raw": "string-width@^1.0.1",
|
||||
"rawSpec": "^1.0.1",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.1 <2.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/wrap-ansi"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "string-width@^1.0.1",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/wrap-ansi",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/string-width/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
"strip-ansi": "^3.0.0"
|
||||
},
|
||||
"description": "Get the visual width of a string - the number of columns required to display it",
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3",
|
||||
"tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b",
|
||||
"homepage": "https://github.com/sindresorhus/string-width#readme",
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"char",
|
||||
"character",
|
||||
"chinese",
|
||||
"cjk",
|
||||
"cli",
|
||||
"codes",
|
||||
"column",
|
||||
"columns",
|
||||
"command-line",
|
||||
"console",
|
||||
"escape",
|
||||
"fixed-width",
|
||||
"full",
|
||||
"full-width",
|
||||
"fullwidth",
|
||||
"japanese",
|
||||
"korean",
|
||||
"str",
|
||||
"string",
|
||||
"terminal",
|
||||
"unicode",
|
||||
"visual",
|
||||
"width"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "string-width",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/string-width.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"version": "1.0.2"
|
||||
}
|
42
node_modules/wrap-ansi/node_modules/string-width/readme.md
generated
vendored
Normal file
42
node_modules/wrap-ansi/node_modules/string-width/readme.md
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# string-width [](https://travis-ci.org/sindresorhus/string-width)
|
||||
|
||||
> Get the visual width of a string - the number of columns required to display it
|
||||
|
||||
Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
|
||||
|
||||
Useful to be able to measure the actual width of command-line output.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save string-width
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const stringWidth = require('string-width');
|
||||
|
||||
stringWidth('古');
|
||||
//=> 2
|
||||
|
||||
stringWidth('\u001b[1m古\u001b[22m');
|
||||
//=> 2
|
||||
|
||||
stringWidth('a');
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
|
||||
- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
|
||||
- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
137
node_modules/wrap-ansi/package.json
generated
vendored
Normal file
137
node_modules/wrap-ansi/package.json
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"wrap-ansi@^2.0.0",
|
||||
"/Users/pmarsceill/_projects/just-the-docs/node_modules/cliui"
|
||||
]
|
||||
],
|
||||
"_from": "wrap-ansi@>=2.0.0 <3.0.0",
|
||||
"_id": "wrap-ansi@2.1.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/wrap-ansi",
|
||||
"_nodeVersion": "4.6.2",
|
||||
"_npmOperationalInternal": {
|
||||
"host": "packages-18-east.internal.npmjs.com",
|
||||
"tmp": "tmp/wrap-ansi-2.1.0.tgz_1480440082575_0.23112521297298372"
|
||||
},
|
||||
"_npmUser": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "sindresorhus"
|
||||
},
|
||||
"_npmVersion": "2.15.11",
|
||||
"_phantomChildren": {
|
||||
"code-point-at": "1.1.0",
|
||||
"is-fullwidth-code-point": "1.0.0",
|
||||
"strip-ansi": "3.0.1"
|
||||
},
|
||||
"_requested": {
|
||||
"name": "wrap-ansi",
|
||||
"raw": "wrap-ansi@^2.0.0",
|
||||
"rawSpec": "^2.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=2.0.0 <3.0.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cliui"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
|
||||
"_shasum": "d8fc3d284dd05794fe84973caecdd1cf824fdd85",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "wrap-ansi@^2.0.0",
|
||||
"_where": "/Users/pmarsceill/_projects/just-the-docs/node_modules/cliui",
|
||||
"author": {
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"name": "Sindre Sorhus",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chalk/wrap-ansi/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"string-width": "^1.0.1",
|
||||
"strip-ansi": "^3.0.1"
|
||||
},
|
||||
"description": "Wordwrap a string with ANSI escape codes",
|
||||
"devDependencies": {
|
||||
"ava": "^0.16.0",
|
||||
"chalk": "^1.1.0",
|
||||
"coveralls": "^2.11.4",
|
||||
"has-ansi": "^2.0.0",
|
||||
"nyc": "^6.2.1",
|
||||
"strip-ansi": "^3.0.0",
|
||||
"xo": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "d8fc3d284dd05794fe84973caecdd1cf824fdd85",
|
||||
"tarball": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "a731af5a3461d92f2af302e81e05ea698a3c8c1a",
|
||||
"homepage": "https://github.com/chalk/wrap-ansi#readme",
|
||||
"keywords": [
|
||||
"256",
|
||||
"ansi",
|
||||
"break",
|
||||
"cli",
|
||||
"color",
|
||||
"colors",
|
||||
"colour",
|
||||
"command-line",
|
||||
"console",
|
||||
"escape",
|
||||
"formatting",
|
||||
"linewrap",
|
||||
"log",
|
||||
"logging",
|
||||
"rgb",
|
||||
"shell",
|
||||
"string",
|
||||
"styles",
|
||||
"terminal",
|
||||
"text",
|
||||
"tty",
|
||||
"wordbreak",
|
||||
"wordwrap",
|
||||
"wrap",
|
||||
"xterm"
|
||||
],
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "bcoe",
|
||||
"email": "ben@npmjs.com"
|
||||
},
|
||||
{
|
||||
"name": "dthree",
|
||||
"email": "threedeecee@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "qix",
|
||||
"email": "i.am.qix@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "sindresorhus",
|
||||
"email": "sindresorhus@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "wrap-ansi",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chalk/wrap-ansi.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coveralls": "nyc report --reporter=text-lcov | coveralls",
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"version": "2.1.0"
|
||||
}
|
73
node_modules/wrap-ansi/readme.md
generated
vendored
Normal file
73
node_modules/wrap-ansi/readme.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# wrap-ansi [](https://travis-ci.org/chalk/wrap-ansi) [](https://coveralls.io/github/chalk/wrap-ansi?branch=master)
|
||||
|
||||
> Wordwrap a string with [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save wrap-ansi
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const chalk = require('chalk');
|
||||
const wrapAnsi = require('wrap-ansi');
|
||||
|
||||
const input = 'The quick brown ' + chalk.red('fox jumped over ') +
|
||||
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
||||
|
||||
console.log(wrapAnsi(input, 20));
|
||||
```
|
||||
|
||||
<img width="331" src="screenshot.png">
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### wrapAnsi(input, columns, [options])
|
||||
|
||||
Wrap words to the specified column width.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string`
|
||||
|
||||
String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk).
|
||||
|
||||
#### columns
|
||||
|
||||
Type: `number`
|
||||
|
||||
Number of columns to wrap the text to.
|
||||
|
||||
#### options
|
||||
|
||||
##### hard
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `false`
|
||||
|
||||
By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width.
|
||||
|
||||
##### wordWrap
|
||||
|
||||
Type: `boolean`<br>
|
||||
Default: `true`
|
||||
|
||||
By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
|
||||
- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
|
||||
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
|
||||
- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Reference in New Issue
Block a user