Travis (.com) GitHub top language

Denomander is a solution for Deno command-line interfaces. It is inspired from commander.js by tj which is the node’s version.

Installation

import Denomander from "https://raw.githubusercontent.com/siokas/denomander/master/mod.ts";

Usage example

At first initialize the app and optionally you may pass the name, description and version of the app. If not you can change them afterwards by setting the app_name, app_description and app_version variables.

let program = new Denomander(
  {
    app_name: "My MY App",
    app_description: "My MY Description",
    app_version: "1.0.1"
  }
);

There are three option types: commands, options and required options. To set an option just call the corresponding method passing a) the sort and the long flag seperated by space and b) the description

program
  .command("new [name]", "Generate a new file")
  .option("-a --address", "Define the address")
  .option("-p --port", "Define the port")
  .requiredOption("-s --server", "Server Name")
  .parse(Deno.args);

  if(program.address){
    server.name = program.server;
  }

  if(program.port){
    s = serve({ port: program.port });
  }

  if(program.new){
    console.log("Creating the file " + program.new);
  }

ToDo

  • program.on() method
  • Custom option processing
  • Option to change default commands (help, version)
  • description(), action() methods

Used

Release History

  • 0.1.0
    • Initial Commit

Meta

Apostolos Siokas – @siokas_apostolossiokas@gmail.com

Contributing

  1. Fork it (https://github.com/yourname/yourproject/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

License

Distributed under the MIT License.

https://github.com/siokas/stacksearch