All files / src/lib ascii.js

70.83% Statements 34/48
100% Branches 1/1
0% Functions 0/4
70.83% Lines 34/48

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x                              
import { styleText } from './style-text.js';
 
const LOGO = styleText(
  'green',
  `
 ██████╗██╗     ███████╗██╗   ██╗███████╗██████╗     ██╗  ██╗ █████╗ ███████╗
██╔════╝██║     ██╔════╝██║   ██║██╔════╝██╔══██╗    ██║ ██╔╝██╔══██╗██╔════╝
██║     ██║     █████╗  ██║   ██║█████╗  ██████╔╝    █████╔╝ ╚█████╔╝███████╗
██║     ██║     ██╔══╝  ╚██╗ ██╔╝██╔══╝  ██╔══██╗    ██╔═██╗ ██╔══██╗╚════██║
╚██████╗███████╗███████╗ ╚████╔╝ ███████╗██║  ██║    ██║  ██╗╚█████╔╝███████║
 ╚═════╝╚══════╝╚══════╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝    ╚═╝  ╚═╝ ╚════╝ ╚══════╝
 
 Your Clever Cloud Kubernetes cluster has been successfully created, it's now starting up!
 
 It will take about 1 minute. To manage it, use the following commands:
   - clever k8s list                                  List your Kubernetes clusters
   - clever k8s get <cluster-id-or-name>              Get information about a specific cluster
   - clever k8s get-kubeconfig <cluster-id-or-name>   Get the kubeconfig file for your cluster
   - clever k8s delete <cluster-id-or-name>           Delete a specific cluster
 
 Learn more about commands with 'clever k8s --help'
 
 For more information, read the documentation https://www.clever.cloud/developers/doc/kubernetes/
 
 Enjoy!
`,
);
 
// const clearScreen = () => process.stdout.write('\x1B[2J\x1B[0f');
const hideCursor = () => process.stdout.write('\x1B[?25l');
const showCursor = () => process.stdout.write('\x1B[?25h');
const sleep = (ms = 42) => new Promise((resolve) => setTimeout(resolve, ms));
 
export async function typewriterLogo() {
  hideCursor();

  const lines = LOGO.split('\n');

  for (const line of lines) {
    for (const char of line) {
      process.stdout.write(char);
      await sleep();
    }
    console.log();
  }

  showCursor();
}