A Node-RED node that selects a random item from an array.
Run the following command in your Node-RED user directory - typically ~/.node-red
npm i node-red-contrib-random-item
A node that selects a random item from an array.
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" }
]
Output will either be a single data type or an array of items if the Max # of items
is greater than one.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- zachowj - Initial work
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details.