You do not have to use Javascript, Node-red is a low code application. You could do this with standard nodes.
e.g.
[{"id":"68ea8547.c02aa4","type":"inject","z":"bf9e1e33.030598","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":60,"wires":[["7106b69a.b98268"]]},{"id":"7106b69a.b98268","type":"change","z":"bf9e1e33.030598","name":"set blinks","rules":[{"t":"set","p":"payload","pt":"msg","to":"[1,0,1,0]","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"topic/path/to/light","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":60,"wires":[["26637ee8.d53c0a"]]},{"id":"26637ee8.d53c0a","type":"split","z":"bf9e1e33.030598","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":490,"y":60,"wires":[["138c48.92de2bb8"]]},{"id":"138c48.92de2bb8","type":"delay","z":"bf9e1e33.030598","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"2","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":650,"y":60,"wires":[["670e4932.d1efe8"]]},{"id":"670e4932.d1efe8","type":"debug","z":"bf9e1e33.030598","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":740,"y":140,"wires":[]}]