scriptor

Simple and easy to use module for basic scripting, used as a replacement for basic bash scripts to improve the display output


Table of Contents

Quick Start

// script.ts
import { Scriptor } from "https://deno.land/x/scriptor@v1.1.0/mod.ts";
const scriptor = new Scriptor();
scriptor.register({
  name: "Say hello",
  script: `echo hello`,
});
scriptor.register({
  name: "Create tmp file",
  script: `touch tmp.txt`,
});
scriptor.register({
  name: "Rm tmp file",
  script: `rm tmp.txt`,
});
await scriptor.run();
$ deno run --allow-run script.ts

1/2 Create tmp file ... OK # <-- The "OK" is green
2/2 Rm tmp file ... OK # <-- The "OK" is green

2/2 completed.

Documentation

scriptor is a simple and easy to use module that can act as a replacement for simple bash scripts.

Why? scriptor improves the output of your ran commands, such as giving each command a status once it is done, directly telling you what command is currently being ran, or if any failed whilst running, display the errors in a nice format at the end.

For each script/command, scriptor will display the name until it has finished. Once it has, it will add a suffix to stdout, to represent the status, eg "OK" or "FAILED".

Alongside this, scriptor will show the process on how many commands have been ran, how many are left, and what number iss currently being processed, as shown by 1/3 <script name> ...

Register a script

scriptor.register({
  name: "Clean up tmp directory",
  script: "rm -rf /tmp",
});

Run all scripts

Onnce you have registered all scripts, you can then run them:

await scriptor.run();

Contributing

Contributors are welcomed!

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.

License

By contributing your code, you agree to license your contribution under the MIT License.