1.3.5 • Published 6 years ago

scicli v1.3.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 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

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.9

6 years ago

1.2.8

6 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago