Skip to content

Instantly share code, notes, and snippets.

View sonntam's full-sized avatar

Marcus Sonntag sonntam

View GitHub Profile
@sonntam
sonntam / subflow_exec_stdin_async.json
Created March 15, 2023 20:30
Node-Red subflow creating a subflow node that functions as an async version of the built-in exec node with stdin support
[
{
"id": "6ea632aca2282da9",
"type": "subflow",
"name": "exec stdin",
"info": "## Inputs \r\n\r\nSimilar to the exec node this starts a process.\r\nThe input message format is as follows:\r\n\r\n```js\r\nmsg = {\r\n topic: \"<command to be executed>\",\r\n timeout: <timeout in milliseconds before process is killed>,\r\n payload: <passed to stdin:optional>\r\n}\r\n```\r\n\r\n## Outputs\r\n\r\nThe first output contains error message from the underlying\r\nnode.js functionality (if any).\r\n\r\nThe second output contains stdout output.\r\n\r\nThe third output contains stderr output.",
"category": "function",
"in": [
{
"x": 60,
@sonntam
sonntam / sqlite_async_exec.json
Created June 4, 2022 21:13
Node-Red sqlite node using custom exec node
[
{
"id": "6ea632aca2282da9",
"type": "subflow",
"name": "exec stdin",
"info": "## Inputs \r\n\r\nSimilar to the exec node this starts a process.\r\nThe input message format is as follows:\r\n\r\n```js\r\nmsg = {\r\n topic: \"<command to be executed>\",\r\n timeout: <timeout in milliseconds before process is killed>,\r\n payload: <passed to stdin:optional>\r\n}\r\n```\r\n\r\n## Outputs\r\n\r\nThe first output contains error message from the underlying\r\nnode.js functionality (if any).\r\n\r\nThe second output contains stdout output.\r\n\r\nThe third output contains stderr output.",
"category": "function",
"in": [
{
"x": 60,
@sonntam
sonntam / machine.js
Last active April 3, 2020 21:43
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sonntam
sonntam / machine.js
Last active April 3, 2020 20:22
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sonntam
sonntam / machine.js
Last active March 30, 2020 11:58
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions