request = require('request')
auth =
url: ''
method: 'POST'
json:
credentials:
username: ""
key: ""
exports = exports ? this
request auth, (err, res, body) ->
exports.inside = body
console.log(exports.inside)
Then above is Coffeescript with the request module for Node.js. I cannot figure out how to get the data inside of the request function out. This has been a major road-block for my application.
Thank you!
** EDIT**
Vadim Baryshev’s update with code did it! Thank you so much 🙂 !
You are trying to output
exports.insidebefore it have been assigned inrequestfunction callback. Becauserequestfunction is asynchronous. You can get result of this function via callback or event.Update: