Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-bool-gate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-bool-gate

Node RED node to include boolean logic gates

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
724
decreased by-22.73%
Maintainers
1
Weekly downloads
 
Created
Source

node-red-contrib-bool-gate npm version npm downloads Unlicense

Node RED node to include boolean logic gates.

Installation

$ npm install node-red-contrib-bool-gate

Restart Node-RED and use the node!

Or from the Node-RED's palette, search for "node-red-contrib-bool-gate".

Check example at "Import > Examples > boolean logic"

Boolean condition

If you know how the boolean logic work, you can skip this section.

The boolean logic is a way to determine a condition regarding to the input.

Condition ACondition BANDNANDORNORXORXNOR
false
false
false
true
false
true
false
true
false
true
false
true
true
false
true
false
true
false
false
true
true
false
true
false
true
true
true
true
true
false
false
true

You can do it to for more than 2 condition :

Condition ACondition BCondition CANDNANDORNORXORXNOR
false
false
false
false
true
false
true
false
true
false
false
true
false
true
true
false
true
false
false
true
false
false
true
true
false
true
false
false
true
true
false
true
true
false
false
true
true
false
false
false
true
true
false
true
false
true
false
true
false
true
true
false
false
true
true
true
false
false
true
true
false
false
true
true
true
true
true
false
true
false
false
true

You can follow this link to learn more about the boolean logic.

Usage

Notion of Rules

A rule can be read from top, like :

<TOPIC><PROPERTY><CONDITION><VALUE>

with topic, the topic of incomming message (if needed), property to perform the test, condition the condition you want for the property and value the value you want for the property (if needed).

You can pick property from everywhere :

  • from the incomming message
  • from the flow context
  • from the global context

The following condition are implemented :

  • ==
  • !=
  • <
  • <=
  • >
  • >=
  • is between
  • contains
  • match regex
  • is true
  • is false
  • is null
  • is not null

You can pick value from the following type (depending on your condition) :

  • number
  • string
  • message's property
  • flow's property
  • global's property
  • regex
  • previous value

Configuration

Please take you time to create your gate, by following these steps :

  • Select the type of gate you want for your node (between AND and NAND for the and-gate and OR, NOR, XOR and XNOR for the or-gate)
  • Tick the "True restriction" checkbox if you want to have output only when the gate is at true state.
  • Fill if needed the "Input message topic" input to filter your incomming message
  • Select the property you need to check (Default : msg, assuming you defined the input message topic)
  • Select the condition(Defautl : =)
  • Type the value you want for your property, assuming you picked up the correct type
  • Add a rule by cliking on + add below the list, and repeat the procedure

See the node information for more details

Keywords

FAQs

Package last updated on 19 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc