jiaola/marc4js

Async/Await

librarywebchic opened this issue · 1 comments

Can this library be used via Async/Await?

I'm using it using async/await by wrapping it in a Promise like this

return new Promise((resolve, reject) => {
    marc4js.parse(data, {
            format: 'marcxml'
        }, function (err, records) {
        if(err) {return reject(err);}
        return resolve(records);
    });
});