xyplug-sample-npx
v1.0.1
Published
A simple NPX example Plugin for the xyOps workflow automation system.
Readme
Overview
This is an example Node.js package which can be downloaded and executed by a single npx command. It is designed to read JSON from STDIN, and output JSON to STDOUT, as part of a bare-bones simple xyOps Event Plugin.
Here is the Plugin command for this package:
npx -y github:pixlcore/xyplug-sample-npx#v1.0.1Here is an example invocation with some test data piped in:
echo '{"xy":1,"test":[2,3]}' | npx -y github:pixlcore/xyplug-sample-npx#v1.0.1Expected output:
Read JSON from STDIN:
{
"xy": 1,
"test": [
2,
3
]
}
{ "xy":1, "code":0 }Note: xyOps will ignore and pass through the "pretty-printed" JSON output, and only consume the compact message at the end.
Notes
- Make sure you have a properly-formatted
package.jsonfile at the root of your repo.- It should have a
binproperty that points at yourindex.jsfile.
- It should have a
- Make sure your
index.jsfile has a Shebang line at the top. - Tag the repo to match the version in
package.json(currently1.0.1):
git tag v1.0.1
git push origin v1.0.1