Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sys = require('sys');
- getData = function(field, callback) {
- console.log('this would get the data from ' + field + ' then continue');
- //db.getFromField(field, function(error, response) {
- //if(!error) {
- // data = response
- // callback(data);
- callback('some data');
- //}
- }
- runner = function() {
- // get data from field, 'username'
- getData('username', function(data) {
- console.log('now you have ' + data)
- // Script wouldn't get in here if getData hadn't returned 'data'
- })
- }
- runner()
Add Comment
Please, Sign In to add comment