M
M
Maxim2019-03-04 06:58:41
Node.js
Maxim, 2019-03-04 06:58:41

How to debug a plugin in node.js?

How to debug scripts in node.js ?
I need to shrink an svg image, I found a script for gulp, it compresses well, but it also deletes the id I need, there is a setting to disable deleting all identifiers, but then it shrinks badly. So I thought to modify the script (cleanupIDs.js ) to add saving some id with my modifier like "MyId_"
I want to see what objects are in what objects and how it works.
How to do it ?
I tried to run it as
svgo -debug Test1.svg -o test1.min.svg
(and set console.log inside the script, it will even work like that)
But it swears (for an unknown parameter) and returns nothing to the console.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Robur, 2019-03-04
@pokk-pokk

Modern IDEs (Webstorm, VsCode) allow you to do the usual debugging - with breakpoints, viewing the stack, variables, and so on. Take any of them, open the help on how to set it all up, how to run the script in debug mode and go.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question