Could someone help me with creating a simple generator counter, only using the JavaScript function node without using context storage?
Here is the prototype, but I can't use it in my application because it uses an additional trigger node
[{"id":"99785fc8.6687a","type":"inject","z":"15cf35e317766a1e","name":"trigger to start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"0","payloadType":"str","x":1550,"y":1940,"wires":[["9bc2c452.643d38"]]},{"id":"5cbf5a97.a340a4","type":"debug","z":"15cf35e317766a1e","name":"","active":true,"console":false,"complete":false,"x":1910,"y":1940,"wires":[]},{"id":"1ab3bd1e42e54874","type":"inject","z":"15cf35e317766a1e","name":"trigger to stop","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"stop","payloadType":"str","x":1550,"y":2000,"wires":[["28e99bac12b0ed7b"]]},{"id":"2ec4101beac37945","type":"group","z":"15cf35e317766a1e","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["9bc2c452.643d38","28e99bac12b0ed7b"],"x":1634,"y":1901,"w":173,"h":140},{"id":"9bc2c452.643d38","type":"function","z":"15cf35e317766a1e","g":"2ec4101beac37945","name":"counter","func":"msg.payload = parseInt(msg.payload) + 1;\n\n\nreturn msg;","outputs":"1","noerr":0,"initialize":"","finalize":"","libs":[],"x":1721,"y":1942,"wires":[["5cbf5a97.a340a4","28e99bac12b0ed7b"]]},{"id":"28e99bac12b0ed7b","type":"trigger","z":"15cf35e317766a1e","g":"2ec4101beac37945","name":"","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"1","extend":false,"overrideDelay":false,"units":"s","reset":"stop","bytopic":"all","topic":"topic","outputs":1,"x":1720,"y":2000,"wires":[["9bc2c452.643d38"]]}]