Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including hubot-pipe with all npm packages installed. Try it out:

var hubotPipe = require("hubot-pipe")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

hubot-pipe v0.0.7

Put some shell in your Hubot

Hubot Pipe

Introduce command piping and subshells to your Hubot commands.

# Expand the output from one command into the invocation of another.
hubot> hubot decide $(hubot echo first) $(hubot echo second)
Definitely "first".

# Append the output from one command to the input of another.
# Equivalent to "hubot echo before $(hubot echo after)".
hubot> hubot echo after | hubot echo before
before after

Subcommands can be nested at arbitrary depths. Pipe sequences can be arbitrarily long, and used within subcommands. (Okay, realistically you're limited by the stack depth.)

pushbot> pushbot echo outer-start $(pushbot echo middle-start $(pushbot echo inner) middle-end) outer-end
outer-start middle-start inner middle-end outer-end

pushbot> pushbot echo 0 $(pushbot echo 2 | pushbot echo 1 )3
pushbot> 0 1 2 3

Installing

  1. Add hubot-pipe to your package.json with npm install --save hubot-pipe:
  "dependencies": {
    "hubot-pipe": "~0.0.4"
  },
  1. Require the module in external-scripts.json:
["hubot-pipe"]
  1. Run npm update and restart your Hubot.
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free