Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smashwilson/hubot-pipe
Put some Unix in your Hubot
https://github.com/smashwilson/hubot-pipe
hubot javascript shell
Last synced: 22 days ago
JSON representation
Put some Unix in your Hubot
- Host: GitHub
- URL: https://github.com/smashwilson/hubot-pipe
- Owner: smashwilson
- License: mit
- Created: 2015-10-07T14:16:59.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T20:00:38.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T14:41:34.051Z (about 1 month ago)
- Topics: hubot, javascript, shell
- Language: JavaScript
- Homepage:
- Size: 211 KB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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-endpushbot> 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`:
```json
"dependencies": {
"hubot-pipe": "~0.0.4"
},
```
2. Require the module in `external-scripts.json`:```json
["hubot-pipe"]
```
3. Run `npm update` and restart your Hubot.