Closed leblanc-simon closed 6 years ago
@leblanc-simon First of all, thanks for your PR! This was a going to be a bit tricky, which is why I kept it separate from #25. I think you're right that a JSON string is the best option, at least initially. I had considered supporting individual options, however, type casting would quickly and easily become an issue.
If you're using Windows, you may have to escape the JSON as you have in your example, otherwise, you should be able to simply wrap the JSON using single quotes.
I'll try to take a deeper look and test this soon. Sadly, I still haven't got around to improving the testing framework to include CLI tests.
I've just released v0.3.3 which includes this change. Thanks again for your PR.
Thanks ! I'm on Linux but I have some difficulties to escape JSON with simple quote. I'm lazy :) So when I found the good escape, I don't search any further
I had to use the same JSON escape sequence on Windows for Powershell...also disabling the GPU and sandbox setting to avoid the hang with Protocol error (Page.enable): target closed error
.
It helped me to start with a simple puppeteer example. This ensures puppeteer is configured and running properly in your workspace.
convert-svg-to-png --puppeteer --% "{\"args\": [\"--disable-gpu\", \"--no-sandbox\"]}" .\example.svg
You have added an awesome option into the API to customize puppeteer. This merge request try to allow use this option into the CLI
Example (because require escape JSON into the CLI... but I don't know how to do this without) :