mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 01:07:01 +08:00
This is a reland of 4df552c652
Original change's description:
> Updates node_modules and update script
>
> Change-Id: I3fcf49bc416301a030d298cfc48c448bfeba4335
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1878808
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Change-Id: I97d1442c21420488fadde3f17f67cd4e3b959be6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1880030
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
cli-width
Get stdout window width, with four fallbacks, tty, output.columns, a custom environment variable and then a default.
Usage
npm install --save cli-width
'use strict';
var cliWidth = require('cli-width');
cliWidth(); // maybe 204 :)
You can also set the CLI_WIDTH environment variable.
If none of the methods are supported, and the environment variable isn't set,
the default width value is going to be 0, that can be changed using the configurable options.
API
cliWidth([options])
cliWidth can be configured using an options parameter, the possible properties are:
- defaultWidth<number> Defines a default value to be used if none of the methods are available, defaults to
0 - output<object> A stream to be used to read width values from, defaults to
process.stdout - tty<object> TTY module to try to read width from as a fallback, defaults to
require('tty')
Examples
Defining both a default width value and a stream output to try to read from:
var cliWidth = require('cli-width');
var ttys = require('ttys');
cliWidth({
defaultWidth: 80,
output: ttys.output
});
Defines a different tty module to read width from:
var cliWidth = require('cli-width');
var ttys = require('ttys');
cliWidth({
tty: ttys
});
Tests
npm install
npm test
Coverage can be generated with npm run coverage.