node-red-contrib-random-item 1.0.3

Node-RED node that randomly selects an item of an array

npm install node-red-contrib-random-item

Release Version License

BuyMeCoffee

node-red-contrib-random-item

A Node-RED node that selects a random item from an array.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm i node-red-contrib-random-item

Usage

A node that selects a random item from an array.

Inputs

Input needs to be in a JSON formatted array.

Examples of inputs:

["first", "second", "third", "fourth"]
[1, 2, 3, 4, 5]
[
  { "name": "George Jetson", "role": "father" },
  { "name": "Jane Jetson", "role": "mother" },
  { "name": "Judy Jetson", "role": "daugter" },
  { "name": "Elroy Jetson", "role": "son" }
]

Outputs

Output will either be a single data type or an array of items if the Max # of items is greater than one.

Find Us

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Node Info

Version: 1.0.3
Updated 4 years, 5 months ago
License: MIT
Rating: 5.0 1

Categories

Actions

Rate:

Downloads

48 in the last week

Nodes

  • random-item

Keywords

  • node-red
  • random

Maintainers