1.3.5 • Published 5 years ago

scicli v1.3.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

SciCLI

Library for interactive promise-based CLI

Usage

/**
 * This test is for basic command handling
 */

//Import scicli
const scicli = require("scicli");

//Create instance
const inst = new scicli();

//Add `exit` command
inst.addCommand("exit", async args => {
  //Occures when `exit` command is executed
  var reason = args.join(" "); //Join all of the arguments into a string, using a space as the seperator of each element
  if (!reason) {
    //Stop requesting input
    inst.stopInput();

    //If no reason provided, show exit message using `alert`
    inst.alert("Exitting without reason...");
    process.exit();
    return;
  }

  //Stop requesting input
  inst.stopInput();

  //If reason provided, show exit message using `info`
  inst.info("Exitting because `" + reason + "`");
  process.exit();
});

//Show welcome message using `success` & `info`
inst.success("Welcome to SciCLI Basic Test");
inst.info("Available Commands: Exit");

//Start requesting input
inst.startInput();
1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago