tigt/mini-svg-data-uri

Feature request: usable via command line

Closed this issue · 4 comments

This is a cool utility, after I found it I started using it all the time. Thank you for this & the research behind it!

I think it could be even more useful and efficient used directly from the command line. It's really so simple and needs only one piece of external data (the svg code). Being able to run something like $ svg2data optimized.svg optimized.svg.datauri would make this 💯 vs going through node prompt / js file / online for standalone file conversions.

tigt commented

I haven't made a node cli tool before but I do know that's where the actual command is defined along with which script it should run. Then it might just be handling the arguments & writing to a file.

I'm pretty swamped at the moment but maybe if I can find some time in the next couple weeks I'll give it a shot if it has yet to be done. I'd love to make an alias that runs svgo and then this in one go.

tigt commented

I’ll see what I can do this weekend. Off the top of my head, the output file should probably have .uri by default, as that maps to text/uri-list in most extension-interpreting libraries.

tigt commented

Implemented by #19