MCPcopy Create free account
hub / github.com/npkgz/cli-progress / constructor

Method constructor

lib/single-bar.js:7–23  ·  view source on GitHub ↗
(options, preset)

Source from the content-addressed store, hash-verified

5module.exports = class SingleBar extends _GenericBar{
6
7 constructor(options, preset){
8 super(_options.parse(options, preset));
9
10 // the update timer
11 this.timer = null;
12
13 // disable synchronous updates in notty mode
14 if (this.options.noTTYOutput && this.terminal.isTTY() === false){
15 this.options.synchronousUpdate = false;
16 }
17
18 // update interval
19 this.schedulingRate = (this.terminal.isTTY() ? this.options.throttleTime : this.options.notTTYSchedule);
20
21 // callback used for gracefulExit
22 this.sigintCallback = null;
23 }
24
25 // internal render function
26 render(){

Callers

nothing calls this directly

Calls 1

isTTYMethod · 0.80

Tested by

no test coverage detected