Guest User

Untitled

a guest
Jun 19th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. sys = require('sys');
  2.  
  3. getData = function(field, callback) {
  4. console.log('this would get the data from ' + field + ' then continue');
  5. //db.getFromField(field, function(error, response) {
  6. //if(!error) {
  7. // data = response
  8. // callback(data);
  9. callback('some data');
  10. //}
  11. }
  12.  
  13. runner = function() {
  14. // get data from field, 'username'
  15. getData('username', function(data) {
  16. console.log('now you have ' + data)
  17. // Script wouldn't get in here if getData hadn't returned 'data'
  18. })
  19. }
  20.  
  21. runner()
Add Comment
Please, Sign In to add comment