Closed gkorland closed 5 years ago
I would really like that PR to get merged... Sync operation are bad.
Meanwhile, I wrote the function instead.
images.Image.prototype.saveAsync = function (file, type, config, callback) {
if (type && typeof(type) === 'object') {
config = type;
type = undefined;
}
if (!callback) {
if (typeof type === 'function') {
callback = type;
type = undefined;
}
if (typeof config === 'function') {
callback = config;
config = undefined;
}
}
fs.writeFile(file, this.encode(type || path.extname(file), config), callback);
return this;
};
Also, the save
method should return this, like all the other ones.
@zhangyuanwei can you please merge this! Thanks!
Ho just saw it's already there! You can close!
add callback to save