Narnia's Poofy Meatcleaver

    basher

    0.2.0 • Public • Published

    Basher.js Build Status

    Run any command or shell script anywhere, in any order.

    Basic "hello" task

    bin/run:

    #!/usr/bin/env node
     
    require("../lib/runner")().run()

    lib/runner.js:

    import { command } from "basher"
     
    class Runner {
      constructor(state) {
        this.state({
          task:  state.options._[0],
          tasks: this.commands
        })
      }
     
      help(state) {
        console.log(`Usage: ./bin/run [task]`)
      }
     
      run(state) {
        return this.tasks(state)
      }
    }
     
    export default command(Runner).include(__dirname)
     

    lib/commands/hello.js:

    import { command } from "basher"
     
    export default command(class {
      description() {
        return "hello description"
      }
     
      help(state) {
        console.log(`Usage: ./bin/run hello`)
      }
     
      run() {
        console.log("hello!")
      }
    })

    Keywords

    none

    Install

    npm i basher

    DownloadsWeekly Downloads

    3

    Version

    0.2.0

    License

    MIT

    Last publish

    Collaborators

    • winton