How to use the ansi-escapes.cursorDown function in ansi-escapes

To help you get started, we’ve selected a few ansi-escapes 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 ismaelgt / metaweather-cli / lib / report.js View on Github external
ansiEscapes.cursorMove(xOffset + 16, 0) +
    'Max: ' + getFormattedTemp(weather.max_temp) +
    ansiEscapes.cursorNextLine +
    // Min temp
    ansiEscapes.cursorMove(xOffset + 16, 0) +
    'Min: ' + getFormattedTemp(weather.min_temp) +
    ansiEscapes.cursorNextLine +
    // Wind
    ansiEscapes.cursorMove(xOffset + 16, 0) +
    getFormattedWind(weather.wind_direction_compass, weather.wind_speed) +
    ansiEscapes.cursorNextLine +
    // Humidity
    ansiEscapes.cursorMove(xOffset + 16, 0) +
    'Humidity: ' + weather.humidity + '%' +
    ansiEscapes.cursorNextLine +
    (column !== 2 ? ansiEscapes.cursorUp(7) : ansiEscapes.cursorDown(1))
  )
}
github SBoudrias / Inquirer.js / packages / inquirer / lib / utils / readline.js View on Github external
exports.down = function(rl, x) {
  rl.output.write(ansiEscapes.cursorDown(x));
};
github dylang / observatory / lib / observatory.js View on Github external
function update() {
        var output = task.render();
        var change = currentLine - task.line;
        out.write(position.cursorUp(change));
        out.write(output);
        out.write(position.cursorDown(change - (out.height(output) - 1)));
        out.write(position.cursorBackward(out.ln(output)));
        return task;
    }
github olistic / warriorjs / packages / warriorjs-cli / src / ui / printBoard.js View on Github external
function printBoard(floorMap, warriorStatus, offset) {
  if (offset > 0) {
    const floorMapRows = floorMap.length;
    print(ansiEscapes.cursorUp(offset + floorMapRows + warriorStatusRows));
  }

  printWarriorStatus(warriorStatus);
  printFloorMap(floorMap);

  if (offset > 0) {
    print(ansiEscapes.cursorDown(offset));
  }
}
github serverless / components / src / utils / getCli.js View on Github external
} else {
          coloredStage = chalk.yellow(stage)
        }

        cli.write(
          `${ansiEscapes.cursorHide +
            ansiEscapes.cursorLeft +
            ansiEscapes.eraseDown}\n  ${chalk.grey(
            `${second}s ${figures.pointerSmall}`
          )} ${coloredStage} ${chalk.grey(figures.pointerSmall)} ${componentName} ${chalk.grey(
            figures.pointerSmall
          )} ${chalk.yellow(cli.msg)}\n${ansiEscapes.cursorLeft + ansiEscapes.cursorUp(2)}`
        )
        if (!cli.running) {
          cli.write(
            `${ansiEscapes.cursorShow + ansiEscapes.cursorLeft + ansiEscapes.cursorDown(2)}\n`
          )
          return
        }
        await sleep(100)
        cli.render(nextFrame)
      },
      write: process.stdout.write.bind(process.stdout)