i try to write an module for my node.js server with require.js that just returns the object i want to get from an url. But somehow i can\'t return the values i get with my metho
You can't have a function that makes an async call just return something (unless it's a promise).
You need to have your function take a callback parameter:
function foo(callback) {
doSomethingAsync(function(data) {
// fire callback, which is a function that takes an argument 'data'
callback(data)
});
}
Then you can use it like this:
foo(function(data) {
doStuffWith(data);
});