[{"data":1,"prerenderedAt":42},["ShallowReactive",2],{"integration-node-red-contrib-counter\u002F":3},{"_id":4,"categories":5,"author":8,"description":12,"npmOwners":13,"npmScope":15,"name":4,"ffCertified":16,"downloads":17,"version":19,"updatedAt":20,"maintainers":21,"homepage":23,"bugs":24,"repository":26,"time":29,"lastUpdated":30,"created":31,"license":37,"githubOwner":38,"githubRepo":39,"examples":40,"readme":41},"node-red-contrib-counter",[6,7],"catalogue_utility","catalogue",{"name":9,"email":10,"url":11},"Daniel 'Eisbehr' Kern","jquery@eisbehr.de","http:\u002F\u002Feisbehr.de","A Node-RED node to create a counter with messages.",[14],"eisbehr",null,false,{"week":18},5489,"0.1.6","2020-07-24T11:50:57.520Z",[22],{"name":14,"email":10},"http:\u002F\u002Fgithub.com\u002Fdkern\u002Fnode-red-counter",{"url":25},"http:\u002F\u002Fgithub.com\u002Fdkern\u002Fnode-red-counter\u002Fissues",{"type":27,"url":28},"git","git+ssh:\u002F\u002Fgit@github.com\u002Fdkern\u002Fnode-red-counter.git",{"modified":30,"created":31,"0.1.0":31,"0.1.2":32,"0.1.3":33,"0.1.4":34,"0.1.5":35,"0.1.6":36},"2022-06-21T19:01:02.580Z","2016-11-08T12:48:19.525Z","2016-11-11T15:26:54.928Z","2016-11-14T11:50:25.457Z","2017-01-18T11:24:49.903Z","2018-05-08T07:21:06.542Z","2020-07-24T11:50:55.321Z","Apache-2.0","dkern","node-red-counter",[],"\u003Ch1 id=\"node-red-contrib-counter\">\u003Ca class=\"header-anchor\" href=\"#node-red-contrib-counter\">node-red-contrib-counter\u003C\u002Fa>\u003C\u002Fh1>\n\u003Cp>\u003Ca href=\"http:\u002F\u002Fgithub.com\u002Fdkern\u002Fnode-red-counter\">\u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fgh\u002Fdkern%2Fnode-red-counter.svg\" alt=\"GitHub version\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"http:\u002F\u002Fwww.npmjs.org\u002Fpackage\u002Fnode-red-contrib-counter\">\u003Cimg src=\"https:\u002F\u002Fbadge.fury.io\u002Fjs\u002Fnode-red-contrib-counter.svg\" alt=\"NPM version\" \u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdavid-dm.org\u002Fdkern\u002Fnode-red-counter\">\u003Cimg src=\"https:\u002F\u002Fdavid-dm.org\u002Fdkern\u002Fnode-red-counter\u002Fstatus.svg\" alt=\"Dependencies Status\" \u002F>\u003C\u002Fa>\u003C\u002Fp>\n\u003Cp>A \u003Ca href=\"http:\u002F\u002Fnodered.org\">Node-RED\u003C\u002Fa> node to create a counter with messages.\u003C\u002Fp>\n\u003Chr \u002F>\n\u003Ch2 id=\"table-of-contents\">\u003Ca class=\"header-anchor\" href=\"#table-of-contents\">Table of Contents\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"#install\">Install\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#usage\">Usage\u003C\u002Fa>\n\u003Cul>\n\u003Cli>\u003Ca href=\"#configuration\">Configuration\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#output\">Output\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#control\">Control\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#example-flows\">Example Flows\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#bugs--feature-request\">Bugs \u002F Feature request\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#license\">License\u003C\u002Fa>\u003C\u002Fli>\n\u003Cli>\u003Ca href=\"#donation\">Donation\u003C\u002Fa>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Chr \u002F>\n\u003Ch2 id=\"install\">\u003Ca class=\"header-anchor\" href=\"#install\">Install\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Run the following command in your Node-RED user directory - typically \u003Ccode>~\u002F.node-red\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre>\u003Ccode>npm install node-red-contrib-counter\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"usage\">\u003Ca class=\"header-anchor\" href=\"#usage\">Usage\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>By default the counter will be incremented for every inbound message and append the current count to \u003Ccode>msg.count\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch3 id=\"configuration\">\u003Ca class=\"header-anchor\" href=\"#configuration\">Configuration\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cul>\n\u003Cli>\u003Ccode>Initial Count\u003C\u002Fcode>: The initial count can be set in the configuration. By default it will be \u003Ccode>zero\u003C\u002Fcode> at start.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Default Step\u003C\u002Fcode>: Default amount that will be incremented or decremented on every incoming message.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Lower Limit\u003C\u002Fcode>: Optional limitation of the lower count limit. Will add \u003Ccode>countLowerLimitReached\u003C\u002Fcode> to \u003Ccode>msg\u003C\u002Fcode> if reached.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Upper Limit\u003C\u002Fcode>: Optional limitation of the upper count limit. Will add \u003Ccode>countUpperLimitReached\u003C\u002Fcode> to \u003Ccode>msg\u003C\u002Fcode> if reached.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Mode\u003C\u002Fcode>: Determine if count value should be incremented or decremented on every incoming message.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Outputs\u003C\u002Fcode>: Selects the output format of the counter. \u003Cem>For more info read below.\u003C\u002Fem>\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"output\">\u003Ca class=\"header-anchor\" href=\"#output\">Output\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>There are two output options for the counter value:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>single\u003C\u002Fcode>: The actual count will be appended to \u003Ccode>msg.count\u003C\u002Fcode> of the original \u003Ccode>msg\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Ccode>split\u003C\u002Fcode>: The node will become two outputs, first will return the count as \u003Ccode>msg.payload\u003C\u002Fcode> and possible limitation info, the second returns the untouched original \u003Ccode>msg\u003C\u002Fcode>.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch3 id=\"control\">\u003Ca class=\"header-anchor\" href=\"#control\">Control\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>It's possible to control the counter with incoming \u003Ccode>msg\u003C\u002Fcode> properties:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>msg.increment\u003C\u002Fcode>: counter will be incremented by the given value.\u003C\u002Fli>\n\u003Cli>\u003Ccode>msg.decrement\u003C\u002Fcode>: counter will be decremented by the given value.\u003C\u002Fli>\n\u003Cli>\u003Ccode>msg.reset\u003C\u002Fcode>: resets the counter to it's initial count, or to the given value, when it's a number.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"example-flows\">\u003Ca class=\"header-anchor\" href=\"#example-flows\">Example Flows\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Simple example showing how to use the counter and it's output.\u003C\u002Fp>\n\u003Cp>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdkern\u002Fnode-red-counter\u002Fmaster\u002Fdoc\u002Fexample1.png\" alt=\"example1.png\" \u002F>\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-JSON\">[{\"id\":\"25b6280d.1ecf6\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"decrement\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":380,\"y\":160,\"wires\":[[\"8a41c1.6006b64\"]]},{\"id\":\"285e0e19.b9680a\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"increment\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":380,\"y\":120,\"wires\":[[\"ce8d952f.18666\"]]},{\"id\":\"fda0a334.bc9588\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"reset\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":370,\"y\":200,\"wires\":[[\"17cce981.975686\"]]},{\"id\":\"ce8d952f.18666\",\"type\":\"function\",\"z\":\"327d23e5.bb5924\",\"name\":\"msg object\",\"func\":\"msg.increment = 2;\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":550,\"y\":120,\"wires\":[[\"ac65bf94.6e609\"]]},{\"id\":\"17cce981.975686\",\"type\":\"function\",\"z\":\"327d23e5.bb5924\",\"name\":\"msg object\",\"func\":\"msg.reset = true;\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":550,\"y\":200,\"wires\":[[\"ac65bf94.6e609\"]]},{\"id\":\"8a41c1.6006b64\",\"type\":\"function\",\"z\":\"327d23e5.bb5924\",\"name\":\"msg object\",\"func\":\"msg.decrement = 1;\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":550,\"y\":160,\"wires\":[[\"ac65bf94.6e609\"]]},{\"id\":\"ac65bf94.6e609\",\"type\":\"counter\",\"z\":\"327d23e5.bb5924\",\"name\":\"\",\"init\":\"0\",\"step\":1,\"lower\":null,\"upper\":null,\"mode\":\"increment\",\"outputs\":\"1\",\"x\":740,\"y\":140,\"wires\":[[\"988afc3c.a08f98\"]]},{\"id\":\"370626a8.22216a\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"normal msg without control parameter\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":470,\"y\":80,\"wires\":[[\"ac65bf94.6e609\"]]},{\"id\":\"988afc3c.a08f98\",\"type\":\"debug\",\"z\":\"327d23e5.bb5924\",\"name\":\"message\",\"active\":true,\"console\":\"false\",\"complete\":\"true\",\"x\":900,\"y\":140,\"wires\":[]}]\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fdkern\u002Fnode-red-counter\u002Fmaster\u002Fdoc\u002Fexample2.png\" alt=\"example2.png\" \u002F>\u003C\u002Fp>\n\u003Cpre>\u003Ccode class=\"language-JSON\">[{\"id\":\"4f41c5a1.85426c\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"decrement\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":380,\"y\":380,\"wires\":[[\"e9085587.2d19c\"]]},{\"id\":\"afb267a8.63739\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"increment\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":380,\"y\":340,\"wires\":[[\"4a35e3c7.3dbd0c\"]]},{\"id\":\"f066adf1.21ba\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"reset\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":370,\"y\":420,\"wires\":[[\"523f8e05.d5537\"]]},{\"id\":\"4a35e3c7.3dbd0c\",\"type\":\"function\",\"z\":\"327d23e5.bb5924\",\"name\":\"msg object\",\"func\":\"msg.increment = 3;\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":550,\"y\":340,\"wires\":[[\"f33ad4bd.777a5\"]]},{\"id\":\"523f8e05.d5537\",\"type\":\"function\",\"z\":\"327d23e5.bb5924\",\"name\":\"msg object\",\"func\":\"msg.reset = 10;\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":550,\"y\":420,\"wires\":[[\"f33ad4bd.777a5\"]]},{\"id\":\"e9085587.2d19c\",\"type\":\"function\",\"z\":\"327d23e5.bb5924\",\"name\":\"msg object\",\"func\":\"msg.decrement = 1;\\nreturn msg;\",\"outputs\":1,\"noerr\":0,\"x\":550,\"y\":380,\"wires\":[[\"f33ad4bd.777a5\"]]},{\"id\":\"9b40b088.73732\",\"type\":\"debug\",\"z\":\"327d23e5.bb5924\",\"name\":\"count\",\"active\":true,\"console\":\"false\",\"complete\":\"payload\",\"x\":890,\"y\":340,\"wires\":[]},{\"id\":\"f33ad4bd.777a5\",\"type\":\"counter\",\"z\":\"327d23e5.bb5924\",\"name\":\"\",\"init\":\"100\",\"step\":\"1\",\"lower\":null,\"upper\":null,\"mode\":\"increment\",\"outputs\":\"2\",\"x\":740,\"y\":360,\"wires\":[[\"9b40b088.73732\"],[\"876cc69d.d4b438\"]]},{\"id\":\"99b73d63.9fdb\",\"type\":\"inject\",\"z\":\"327d23e5.bb5924\",\"name\":\"normal msg without control parameter\",\"topic\":\"\",\"payload\":\"\",\"payloadType\":\"date\",\"repeat\":\"\",\"crontab\":\"\",\"once\":false,\"x\":470,\"y\":300,\"wires\":[[\"f33ad4bd.777a5\"]]},{\"id\":\"876cc69d.d4b438\",\"type\":\"debug\",\"z\":\"327d23e5.bb5924\",\"name\":\"message\",\"active\":false,\"console\":\"false\",\"complete\":\"true\",\"x\":900,\"y\":380,\"wires\":[]}]\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch2 id=\"bugs--feature-request\">\u003Ca class=\"header-anchor\" href=\"#bugs--feature-request\">Bugs \u002F Feature request\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>Please \u003Ca href=\"http:\u002F\u002Fgithub.com\u002Fdkern\u002Fnode-red-counter\u002Fissues\">report\u003C\u002Fa> bugs and feel free to \u003Ca href=\"http:\u002F\u002Fgithub.com\u002Fdkern\u002Fnode-red-counter\u002Fissues\">ask\u003C\u002Fa> for new features directly on GitHub.\u003C\u002Fp>\n\u003Ch2 id=\"license\">\u003Ca class=\"header-anchor\" href=\"#license\">License\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>This project is licensed under \u003Ca href=\"http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\">Apache 2.0\u003C\u002Fa> license.\u003C\u002Fp>\n\u003Ch2 id=\"donation\">\u003Ca class=\"header-anchor\" href=\"#donation\">Donation\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Cem>You like to support me?\u003C\u002Fem>\u003Cbr \u002F>\n\u003Cem>You appreciate my work?\u003C\u002Fem>\u003Cbr \u002F>\n\u003Cem>You use it in commercial projects?\u003C\u002Fem>\u003C\u002Fp>\n\u003Cp>Feel free to make a little \u003Ca href=\"https:\u002F\u002Fwww.paypal.com\u002Fcgi-bin\u002Fwebscr?cmd=_s-xclick&amp;hosted_button_id=FFL6VQJCUZMXC\">donation\u003C\u002Fa>! :wink:\u003C\u002Fp>\n",1788453066797]