Tidy datagenerator, random and smaz nodes

This commit is contained in:
Dave Conway-Jones
2019-09-20 21:22:14 +01:00
parent 171f78ca5b
commit e8a7af18d6
9 changed files with 23 additions and 20 deletions

View File

@@ -7,16 +7,16 @@ data values from a template. Useful for building test-cases.
Install
-------
Run the following command in your Node-RED user directory - typically `~/.node-red`
Either use the Manage Palette option in the Node-RED Editor menu, or run the following command in your Node-RED user directory - typically `~/.node-red`
npm install node-red-node-data-generator
npm i node-red-node-data-generator
Usage
-----
Creates dummy data based on a handlebars-style template.
Uses the <i><a href="https://github.com/webroo/dummy-json" target="_new">dummy-json</a></i>
Uses the <i><a href="https://github.com/webroo/dummy-json/blob/master/README.md" target="_new">dummy-json</a></i>
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

View File

@@ -27,12 +27,12 @@
<script type="text/x-red" data-help-name="data-generator">
<p>Creates dummy data strings based on a handlebars-style template.</p>
<p>Uses the <i><a href="https://github.com/webroo/dummy-json" target="_new">dummy-json</a></i>
<p>Uses the <i><a href="https://github.com/webroo/dummy-json/blob/master/README.md" target="_new">dummy-json</a></i>
module, which can create rich sets of dummy data for testing or other uses.</p>
<p>Will build a string or a parsed JSON object, creating values based on the helper names below:
<pre style="word-break:normal">title, firstName, lastName, company, domain, tld, email, street, city, country, countryCode, zipcode, postcode, lat, long, phone, color, hexColor, guid, ipv4, ipv6, lorem [nn], date, time, lowercase, uppercase, int, float, boolean</pre>
<p>Multiple values can be generated by use of the <i>repeat</i> syntax.</p>
<p>In addition any properties passed in on <code>msg</code> can also be used - for example {{payload}}.</p>
<p>In addition any properties passed in on <code>msg</code> can also be used - for example <code>{{payload}}</code>.</p>
<p>Finally <code>msg.seed</code> can be used to preset the pseudo-random seed to ensure repeatability across calls.</p>
</script>
@@ -56,6 +56,7 @@
label: function() {
return this.name || "data generator";
},
outputLabels: function() { return this.syntax === "json" ? "object" : "string"; },
oneditprepare: function() {
var that = this;
if (!this.fieldType) {

View File

@@ -1,9 +1,9 @@
{
"name" : "node-red-node-data-generator",
"version" : "0.0.5",
"version" : "0.1.0",
"description" : "A Node-RED node to create a string of dummy data values from a template. Useful for test-cases.",
"dependencies" : {
"dummy-json": "1.*"
"dummy-json": "^2.0.0"
},
"repository" : {
"type":"git",