Return data to body.helpers from npm package

Hi guys,

i’m learning Meteor, and JavaScript together with it :slight_smile:
So it’s a pretty steep learning curve…

at this point i’m trying to get a result back to a helper but i can’t get it to work.

here’s the code:
if(Meteor.isServer){
Meteor.methods({
adsGetSymbols: function(){
var adsApi = Meteor.npmRequire(“ads”)
var options = {
host: “10.10.10.191”,
amsNetIdTarget: “5.26.135.60.1.1”,
amsNetIdSource: “10.10.10.182.1.1”,
}
client = adsApi.connect(options, function() {
this.readDeviceInfo(function(err, result) {
console.log(result)
this.end()
})

  })
  console.log(a)
  client.on('error', function(error) {
    console.log(error)
  })
}

})
}

i need “result” given back to the Meteor.call(“adsGetSymbols”);
i have been reading on javascript functions and nested functions but i can’t figure out how to get the value back.

thnx