Page 1 of 1

Node JS debug

Posted: Wed Aug 19, 2020 7:41 am
by Sunnyland
Ok so really wet behind the ears with Nodejs but thought I would change a couple of my scripts from javascript to NodeJs, so far I have just made a basic script that I copied from the Enfocus scripting manual and run it. Idea is just to get a feel for the debug system first and then work on the rest.

What I have found is that everytime I update the main.js file, I have to go into switch scripter relink main.js, and restart the flow for the changes to be applied. Does that sound right?

Also since I am learning NodeJs at the sametime wnat would I use to read an XML file to get the values of specific nodes. The best I can find so far seems to be xml-query@1.5.0 or is there something better?

Re: Node JS debug

Posted: Wed Aug 19, 2020 5:55 pm
by mkayyyy
What I have found is that everytime I update the main.js file, I have to go into switch scripter relink main.js, and restart the flow for the changes to be applied. Does that sound right?
That's correct. I've found that whilst working on a script leaving it open in SwitchScripter will save you having to select the updated main.js file again (As it will still be pointed to the main.js file you selected, see screenshot below). Then you can save it in SwitchScripter and restart the flow.
Image
Also since I am learning NodeJs at the sametime wnat would I use to read an XML file to get the values of specific nodes. The best I can find so far seems to be xml-query@1.5.0 or is there something better?
For XML and XPath so far I've used both these packages https://www.npmjs.com/package/xmldom and https://www.npmjs.com/package/xpath together.

I had to spend a fair bit of time reading through the docs and a bit of Googling (But I've had to do that with most Node packages so far to be fair :lol: ) but got them working as I needed in a script that reads a dataset and updates/adds nodes.

Re: Node JS debug

Posted: Fri Aug 21, 2020 7:11 am
by Sunnyland
Cheers mkayyy, that is working perfectly.

Just spent all day trying to do a SOAP request, another question for the forum I think. :D