Svgo: Npm module without promise

Created on 11 May 2017  路  9Comments  路  Source: svg/svgo

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.

Most helpful comment

SVGO v1.0.0 with a promise has been released.

All 9 comments

That change hasn't get to release yet.

So how is it works in current version?

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mahnunchik picture mahnunchik  路  3Comments

wuz picture wuz  路  3Comments

pixelass picture pixelass  路  6Comments

crybat picture crybat  路  6Comments

ai picture ai  路  5Comments