Async/Await
librarywebchic opened this issue · 1 comments
librarywebchic commented
Can this library be used via Async/Await?
ulikoehler commented
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);
});
});