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!")
  }
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i basher

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • winton