{"id":18612,"library":"node-red-contrib-simple-gate","title":"Simple Gate","description":"A Node-RED gate node that controls message flow by opening or closing a gate. Current stable version is 0.5.2, released with support for asynchronous context stores and improved persistence. Key differentiators: allows user-defined control topic and command strings, supports toggle and status commands, and can restore state from persistent context stores if available. Cannot queue messages; for queuing, use the companion node-red-contrib-queue-gate package. Compatible with Node-RED 0.18+.","status":"active","version":"0.5.2","language":"javascript","source_language":"en","source_url":"https://github.com/drmibell/node-red-contrib-simple-gate","tags":["javascript","node-red","gate","flow control"],"install":[{"cmd":"npm install node-red-contrib-simple-gate","lang":"bash","label":"npm"},{"cmd":"yarn add node-red-contrib-simple-gate","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-red-contrib-simple-gate","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Requires Node-RED runtime to register custom nodes; not a standalone library.","package":"node-red","optional":true}],"imports":[{"note":"This is a Node-RED node, not a JavaScript library. It must be installed in your Node-RED user directory and added via the palette. No code import is required.","wrong":"Attempting to import JS module: const gate = require('node-red-contrib-simple-gate')","symbol":"gate","correct":"Install via npm: npm install node-red-contrib-simple-gate (then use the 'gate' node in the editor palette)"}],"quickstart":{"code":"// No code example; this is a Node-RED node.\n// To use: Install the package, then add a 'gate' node from the palette.\n// Configure control topic and command strings in the node edit dialog.\n// Send control messages with payload 'open', 'close', 'toggle', etc. on the control topic to change state.","lang":"javascript","description":"Shows that the package is a Node-RED node requiring installation and palette usage, not code imports."},"warnings":[{"fix":"Upgrade to 0.5.0 or later and configure appropriate context store in Node-RED settings.","message":"State persistence: versions prior to 0.5.0 used only the default context store, which might be volatile. After upgrade, if using non-default stores, persistence may fail.","severity":"breaking","affected_versions":"<0.5.0"},{"fix":"Use version 0.5.2 or later.","message":"Support for asynchronous context stores was added in 0.5.2; older versions may not work with async stores.","severity":"breaking","affected_versions":"<0.5.2"},{"fix":"Upgrade Node-RED to 0.18+ or use a different gate node.","message":"Not compatible with Node-RED version 0.18 and earlier.","severity":"breaking","affected_versions":">=0.0.0 <0.19.0"},{"fix":"Use node-red-contrib-queue-gate if you need queuing.","message":"Messages that arrive when the gate is closed are discarded without warning; there is no queue or buffer.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure control message payloads are strings, or verify numerical equivalence.","message":"Control messages with payloads that are numbers or booleans are converted to strings before comparison; this may cause unexpected behavior if command strings are numeric.","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Navigate to your Node-RED user directory (typically ~/.node-red) and run: npm install node-red-contrib-simple-gate","cause":"Node-RED cannot locate the package because it was not installed correctly or is in the wrong directory.","error":"Error: Cannot find module 'node-red-contrib-simple-gate'"},{"fix":"Restart Node-RED and check the palette manager. If still missing, try installing via Manage Palette in the editor.","cause":"Node-RED needs to be restarted after installation, or the palette may not be updated.","error":"Gate node not showing in palette"},{"fix":"Upgrade Node-RED to version 0.18 or higher.","cause":"Node-RED version is too old (pre-0.18) and incompatible with this node.","error":"TypeError: Cannot read property 'on' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}