How to use the cli-cursor.hide function in cli-cursor

To help you get started, we’ve selected a few cli-cursor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SBoudrias / Inquirer.js / packages / inquirer / lib / prompts / checkbox.js View on Github external
.pipe(takeUntil(validation.success))
      .forEach(this.onUpKey.bind(this));
    events.normalizedDownKey
      .pipe(takeUntil(validation.success))
      .forEach(this.onDownKey.bind(this));
    events.numberKey
      .pipe(takeUntil(validation.success))
      .forEach(this.onNumberKey.bind(this));
    events.spaceKey
      .pipe(takeUntil(validation.success))
      .forEach(this.onSpaceKey.bind(this));
    events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this));
    events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this));

    // Init the prompt
    cliCursor.hide();
    this.render();
    this.firstRender = false;

    return this;
  }
github makuga01 / dnsFookup / FE / node_modules / inquirer / lib / prompts / checkbox.js View on Github external
.pipe(takeUntil(validation.success))
      .forEach(this.onUpKey.bind(this));
    events.normalizedDownKey
      .pipe(takeUntil(validation.success))
      .forEach(this.onDownKey.bind(this));
    events.numberKey
      .pipe(takeUntil(validation.success))
      .forEach(this.onNumberKey.bind(this));
    events.spaceKey
      .pipe(takeUntil(validation.success))
      .forEach(this.onSpaceKey.bind(this));
    events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this));
    events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this));

    // Init the prompt
    cliCursor.hide();
    this.render();
    this.firstRender = false;

    return this;
  }
github SBoudrias / Inquirer.js / packages / inquirer / lib / prompts / list.js View on Github external
var events = observe(this.rl);
    events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this));
    events.normalizedDownKey
      .pipe(takeUntil(events.line))
      .forEach(this.onDownKey.bind(this));
    events.numberKey.pipe(takeUntil(events.line)).forEach(this.onNumberKey.bind(this));
    events.line
      .pipe(
        take(1),
        map(this.getCurrentValue.bind(this)),
        flatMap(value => runAsync(self.opt.filter)(value).catch(err => err))
      )
      .forEach(this.onSubmit.bind(this));

    // Init the prompt
    cliCursor.hide();
    this.render();

    return this;
  }
github borela-tech / js-toolbox / src / ui / Tty.js View on Github external
start() {
    cursor.hide()

    const TICKER = setInterval(() => {
      const ERASE_FRAME = this.getFrameEraser()
      const LOG_MESSAGES = this.renderLogMessages()
      const SPINNER = this.renderSpinner()
      process.stdout.write(ERASE_FRAME + LOG_MESSAGES + SPINNER)
    }, 1000 / this._fps)

    onExit(() => {
      clearInterval(TICKER)
      process.stdout.write(this.getFrameEraser())
    })
  }
}
github prisma / lift / src / Lift.ts View on Github external
constructor(private migrations: LocalMigrationWithDatabaseSteps[], silent: boolean) {
    cliCursor.hide()
    this.silent = silent
  }
github Anifacted / lerna-update-wizard / src / prompts / semverList.js View on Github external
_run(cb) {
    this.done = cb;
    this.prefixes = ["~", "", "^"];
    this.selectedIndex = 0;
    this.semverPrefix = null;
    this.paginator = new Paginator(this.screen);

    cliCursor.hide();

    const events = observe(this.rl);

    events.line.subscribe(this.onSubmit.bind(this));
    events.keypress.subscribe(({ key, key: { name: keyName } }) => {
      switch (keyName) {
        case "up":
        case "down":
          this.selectedIndex = cycle(
            this.opt.choices.length,
            this.selectedIndex,
            keyName === "up"
          );
          this.semverPrefix = null;
          return this.render();
        case "left":
github jcarpanelli / spinnies / index.js View on Github external
updateSpinnerState(name, options = {}, status) {
    if (this.spin) {
      clearInterval(this.currentInterval);
      this.currentInterval = this.loopStream();
      if (!this.isCursorHidden) cliCursor.hide();
      this.isCursorHidden = true;
      this.checkIfActiveSpinners();
    } else {
      this.setRawStreamOutput();
    }
  }
github YMFE / ykit / lib / utils / ora.js View on Github external
value: function start() {
            if (!this.enabled || this.id) {
                return this;
            }

            cliCursor.hide();
            this.render();
            this.id = setInterval(this.render.bind(this), this.interval);

            return this;
        }
    }, {
github EvanBacon / react-native-ink / src / exports / App / index.tsx View on Github external
componentDidMount() {
    cliCursor.hide(this.props.stdout);
  }

cli-cursor

Toggle the CLI cursor

MIT
Latest version published 1 day ago

Package Health Score

77 / 100
Full package analysis