Skip to content

Instantly share code, notes, and snippets.

@rclai
rclai / meteor-wrapAsync.js
Last active Aug 1, 2021
Flexible example of Meteor.wrapAsync
View meteor-wrapAsync.js
// Thanks @trusktr
var requestSync = Meteor.wrapAsync(function(url, callback) {
request(url, function(error, response, body) {
callback(error, {response: response, body: body})
})
});
var result = requestSync("http://google.com");
console.log(result.response, result.body);