There is promise in example https://github.com/svg/svgo/blob/master/examples/test.js . But when i load npm module svgo i get 0.7.2 version with callback.
That change hasn't get to release yet.
So how is it works in current version?
As it stated in a version before: https://github.com/svg/svgo/blob/8429ffb53ca298ecb2bda96dd58327d115e91b40/examples/test.js
@GreLI when will the new version release??
When it'd be done. There are some things to manage yet, but hopefully it'll help in future.
@GreLI is there a milestone or timeline?
it's quite confusing, the npm module is version 0.7.2 and .optimize is callback-based
master branch here is 0.7.2 and has the promise api
so we should probably change version to 0.8.0 or any non-minor version change
Also, the callback API is non-standard, both errors and results are passed back in the first argument:
if (this.config.error) return callback(this.config);
and later on
callback(svgjs);
SVGO v1.0.0 with a promise has been released.
Most helpful comment
SVGO v1.0.0 with a promise has been released.