potrace
potrace copied to clipboard
Create a CLI command for potrace
It would be nice to be able to just run this from the command line.
Like potrace ./x.png ./x.svg.
I even wrote a script like this:
#!/usr/bin/env node
const fs = require('fs');
const process = require('process');
const potrace = require('oslllo-potrace');
/* eslint-disable no-console */
async function main(argv = process.argv) {
argv = argv.slice(2);
const imageIn = argv[0];
const imageOut = argv[1];
const traced = await potrace(imageIn).trace();
await fs.promises.writeFile(imageOut, traced);
}
void main();
It's super basic atm.
Cool. If you can make a PR I will be cool with merging it. Also, if you could use yargs like this that would be cool.