node-red-contrib-random-item
v1.0.3
Published
Node-RED node that randomly selects an item of an array
Downloads
179
Readme
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
- zachowj - Initial work
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.