javascript - How do I log anything to the console from meteor shell? -


this github issue documents console doesn't output meteor shell. there workarounds? default console.log() statements output in app's stdout (not in shell).

let's want print items collection:

meteor.users.find().foreach(function (user) {      if (...) console.log(user.emails[0].address; }); 

that won't print anything. here's i've tried:

  1. process.stdout.write() - doesn't print anything
  2. create string buffer, append want log it, , evaluate it.

    var output = ''; meteor.users.find().foreach(function (user) {     if (...)         output += user.emails[0].address + "\n" }); output; 

    this works \n echoed literally, not line feed.

  3. evaluate expression in function. predictably, doesn't print anything.

one workaround i've used run app in background, run shell in same window. i.e.

meteor run & meteor shell 

that way, gets output in app's console gets printed window. admittedly, won't if want log specific messages shell, helps if want avoid switching , forth between multiple windows time.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -