Closed Richienb closed 4 years ago
async _convert(imgPath) {
return new Promise((resolve, reject) => {
imageToAscii(imgPath, { colored: false }, (err, converted) => {
if (err) {
reject(err);
return;
}
resolve(converted);
});
});
}
You can wrap it yourself
@rmlzy Or I could use pify
:
const pify = require("pify")
const imageToAscii = pify(require("image-to-ascii"))
@Richienb Nice!
You can use util.promisify
for now. Maybe in a future version Promises will be added. Contributions are welcome.
It would be nice if image-to-ascii supported returning promises.