How to use the ansi-escape-sequences.cursor function in ansi-escape-sequences

To help you get started, we’ve selected a few ansi-escape-sequences 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 machinelabs / machinelabs / server / src / code-runner / downloader / docker-file-downloader.spec.ts View on Github external
.subscribe(null, null, () => {
        expect(outgoingMessages.length).toBe(8);
        expect(outgoingMessages[0]).toEqual(stdoutMsg(`Downloading inputs. Hold on.${newLine()}`));
        // tslint:disable-next-line
        expect(outgoingMessages[1]).toEqual(
          stdoutMsg(
            `${ansi.cursor.down(3)}\rDownloading ${bold(inputs[0].url)} to ${bold('./inputs/' + inputs[0].name)}`
          )
        );
        expect(outgoingMessages[2]).toEqual(
          stdoutMsg(
            `${ansi.cursor.down(3)}\rDownloading ${bold(inputs[1].url)} to ${bold('./inputs/' + inputs[1].name)}`
          )
        );
        // jump 5 lines up after both captions are written
        expect(outgoingMessages[3]).toEqual(stdoutMsg(ansi.cursor.up(5)));
        // tslint:disable-next-line
        expect(outgoingMessages[4]).toEqual(
          stdoutMsg(
            ansi.cursor.down(downloader.relativeOffset(0)) +
              `progress 1st file` +
              ansi.cursor.up(downloader.relativeOffset(0))
          )
github machinelabs / machinelabs / server / src / code-runner / downloader / docker-file-downloader.spec.ts View on Github external
`${ansi.cursor.down(3)}\rDownloading ${bold(inputs[0].url)} to ${bold('./inputs/' + inputs[0].name)}`
          )
        );
        expect(outgoingMessages[2]).toEqual(
          stdoutMsg(
            `${ansi.cursor.down(3)}\rDownloading ${bold(inputs[1].url)} to ${bold('./inputs/' + inputs[1].name)}`
          )
        );
        // jump 5 lines up after both captions are written
        expect(outgoingMessages[3]).toEqual(stdoutMsg(ansi.cursor.up(5)));
        // tslint:disable-next-line
        expect(outgoingMessages[4]).toEqual(
          stdoutMsg(
            ansi.cursor.down(downloader.relativeOffset(0)) +
              `progress 1st file` +
              ansi.cursor.up(downloader.relativeOffset(0))
          )
        );
        expect(outgoingMessages[5]).toEqual(
          stdoutMsg(
            ansi.cursor.down(downloader.relativeOffset(1)) +
              `progress 2nd file` +
              ansi.cursor.up(downloader.relativeOffset(1))
          )
        );
        // jump 9 lines down and write a new line after both downloads completed
        expect(outgoingMessages[6]).toEqual(stdoutMsg(ansi.cursor.down(9) + newLine()));
        expect(outgoingMessages[7]).toEqual(stdoutMsg(`Finished downloading inputs${newLine()}`));
        done();
      });
  });
github machinelabs / machinelabs / server / src / code-runner / downloader / docker-file-downloader.ts View on Github external
const writeCaption = (value: LabInput) =>
      `${ansi.cursor.down(this.lineHeight)}\rDownloading ${bold(value.url)} to ${bold('./inputs/' + value.name)}`;
github 75lb / handbrake-js / bin / cli.js View on Github external
function column (n, msg) {
  process.stdout.write(ansi.cursor.horizontalAbsolute(n) + msg)
}
github machinelabs / machinelabs / server / src / code-runner / downloader / docker-file-downloader.ts View on Github external
map(msg => {
            const offset = this.relativeOffset(index);
            msg.str = ansi.cursor.down(offset) + msg.str + ansi.cursor.up(offset);
            return msg;
          })
        )

ansi-escape-sequences

A simple library containing all known terminal ansi escape codes and sequences.

MIT
Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis