node-red-mockingbird
base on node-red-node-web-data-generator
A Node-RED node to create a mockdata for test-cases.
Install
Run the following command in your Node-RED user directory - typically ~/.node-red
npm install node-red-contrib-mockingbird
Usage
Creates dummy data based on a handlebars-style template.
Uses the dummy-json module, which can create rich sets of dummy data for testing or other uses.
It will build a string, or a parsed JSON object, creating values based on the helper names below:
title, firstname, lastname, company, domain, tld, email,
street, city, country, countryCode, zipcode, postcode,
lat, long, phone, color, hexColor, guid,
ipv4, ipv6, lorem, date, time,
lowercase, uppercase, int, float, boolean
Multiple values can be generated by use of the repeat
syntax.
In addition any properties passed in on the msg
object can also be used - for example {{payload}}.
Finally msg.seed
can be used to preset the pseudo-random seed to ensure repeatability across calls.
Example
The example flow below produces a JSON string which is then converted into an object, for example:
{
"name": "Theo Cumbie",
"work": "CoreXTS",
"email": "theo.cumbie@corexts.gov",
"address": "83 Sherman Road",
"country": "Angola",
"text": "Sagittis orci elementum e vel scelerisque. Amet ac tristique lectus. Morbi e suscipit scelerisque auctor curabitur velit metus gravida quis."
}
Example flow