@tbrandenburg/node-red-cli 0.2.3 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -18
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
5
  [![Node.js >=24](https://img.shields.io/badge/node-%3E%3D24-brightgreen.svg)](package.json)
6
6
 
7
+ > Install the CLI with `npm install -g @tbrandenburg/node-red-cli`.
8
+
7
9
  ## Call Node-RED flows like Unix functions ⚡
8
10
 
9
11
  `node-red-cli` explores a simple, powerful idea: existing Node-RED flows
@@ -21,7 +23,7 @@ By default only the resulting payload is printed as plain text. Pass
21
23
  `--format=json` to print the full result object as JSON instead:
22
24
 
23
25
  ```bash
24
- node bin/node-red-cli.js test/fixtures/flows.json calculate \
26
+ node-red-cli test/fixtures/flows.json calculate \
25
27
  --set x=4 --set y=5 --format=json < /dev/null
26
28
  ```
27
29
 
@@ -32,6 +34,15 @@ node bin/node-red-cli.js test/fixtures/flows.json calculate \
32
34
  This turns Node-RED from a visual automation tool into a reusable runtime
33
35
  building block for scripts, services, pipelines, and developer tooling. 🧩
34
36
 
37
+ ## Install 📦
38
+
39
+ ```bash
40
+ npm install -g @tbrandenburg/node-red-cli
41
+ ```
42
+
43
+ This installs the `node-red-cli` command globally, ready to use against
44
+ any Node-RED flow file (see [Quick start](#quick-start-) below).
45
+
35
46
  ## The idea 💡
36
47
 
37
48
  An existing flow becomes a clean input/output interface:
@@ -97,15 +108,6 @@ test/e2e/ Full round trip through the example flow
97
108
  test/fixtures/ Example Node-RED flow used as a test asset
98
109
  ```
99
110
 
100
- ## Install 📦
101
-
102
- ```bash
103
- npm install -g @tbrandenburg/node-red-cli
104
- ```
105
-
106
- This installs the `node-red-cli` command globally, ready to use against
107
- any Node-RED flow file (see [Quick start](#quick-start-) below).
108
-
109
111
  ## Quick start 🚀
110
112
 
111
113
  To build and run from a repo checkout instead (e.g. for contributing):
@@ -118,8 +120,8 @@ make test
118
120
  `make install` also wires up a `pre-push` git hook that runs `make ci`
119
121
  (format, lint, and tests) automatically before every push.
120
122
 
121
- To use `node-red-cli` as a regular command from a checkout instead of via
122
- `node bin/...`, install it globally from the local source:
123
+ To use `node-red-cli` as a regular command from a repo checkout, install it
124
+ globally from the local source:
123
125
 
124
126
  ```bash
125
127
  make install-global
@@ -128,7 +130,7 @@ make install-global
128
130
  Try the CLI directly against the example flow:
129
131
 
130
132
  ```bash
131
- echo '{"payload":{"x":4,"y":5}}' | node bin/node-red-cli.js test/fixtures/flows.json calculate
133
+ echo '{"payload":{"x":4,"y":5}}' | node-red-cli test/fixtures/flows.json calculate
132
134
  ```
133
135
 
134
136
  ```
@@ -143,7 +145,7 @@ node, it is used automatically (with a warning on stderr if it also had to be
143
145
  inferred across multiple tabs):
144
146
 
145
147
  ```bash
146
- echo '{"payload":{"x":4,"y":5}}' | node bin/node-red-cli.js test/fixtures/single-link-in.flows.json
148
+ echo '{"payload":{"x":4,"y":5}}' | node-red-cli test/fixtures/single-link-in.flows.json
147
149
  ```
148
150
 
149
151
  Instead of building the whole JSON message yourself, individual payload
@@ -153,7 +155,7 @@ becomes a number, `true` a boolean), otherwise kept as plain strings, and they
153
155
  are applied on top of (and override) any payload read from stdin:
154
156
 
155
157
  ```bash
156
- node bin/node-red-cli.js test/fixtures/flows.json calculate \
158
+ node-red-cli test/fixtures/flows.json calculate \
157
159
  --set x=4 --set y=5 < /dev/null
158
160
  ```
159
161
 
@@ -176,7 +178,7 @@ to satisfy this CLI's file-based API. It is mutually exclusive with the
176
178
  The flow is never written to disk in any of these forms.
177
179
 
178
180
  ```bash
179
- node bin/node-red-cli.js --flow-json @test/fixtures/flows.json calculate \
181
+ node-red-cli --flow-json @test/fixtures/flows.json calculate \
180
182
  --set x=4 --set y=5 < /dev/null
181
183
  ```
182
184
 
@@ -190,7 +192,7 @@ consumed by the flow definition instead, so `msg` must be built entirely from
190
192
  `--set` params:
191
193
 
192
194
  ```bash
193
- node bin/node-red-cli.js --flow-json - calculate --set x=4 --set y=5 \
195
+ node-red-cli --flow-json - calculate --set x=4 --set y=5 \
194
196
  < test/fixtures/flows.json
195
197
  ```
196
198
 
@@ -219,7 +221,7 @@ invocation and deletes it afterwards, so only the node types bundled with
219
221
  invocation.
220
222
 
221
223
  ```bash
222
- node bin/node-red-cli.js flows.json calculate \
224
+ node-red-cli flows.json calculate \
223
225
  --user-dir ~/.cache/node-red-cli \
224
226
  --node-modules node-red-node-random \
225
227
  --set x=4 --set y=5 < /dev/null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbrandenburg/node-red-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.6",
4
4
  "description": "Call existing Node-RED flows from Node.js and the command line",
5
5
  "main": "src/link-call.js",
6
6
  "bin": {