legacyLibrary.getData(id, (err, data) => { if (err) console.error(err); console.log(data); }); I wanted to use it inside a Meteor method without nesting. Solution:
If you're still using Meteor.wrapAsync , you're writing legacy code (but it works!). Here's the modern take: meteor wrapasync
Meteor 3 has removed Fibers. wrapAsync still works, but you should migrate to native async/await : legacyLibrary
Need to use an old-school callback function in Meteor? wrapAsync has your back. { if (err) console.error(err)
const readFileSync = Meteor.wrapAsync(fs.readFile); const content = readFileSync('/path/to/file', 'utf8'); But remember: in Meteor 3, just use fs.promises.readFile with await . Progress! ⚡