MeteorJS: how to read stdin from terminal?

Can stdin be read from terminal in Meteor app? I want to run some prompts using Node readline .

I tried the example on the readline page, but I get a prompt printed to the terminal without waiting for a response:

var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});

rl.question("What do you think of node.js? ", function(answer) {
  // TODO: Log the answer in a database
  console.log("Thank you for your valuable feedback:", answer);

  rl.close();
});

      

This code works fine in a normal NodeJS script.

Related tickets:

  • https://github.com/practicalmeteor/meteor-mcli/issues/6
+3
meteor


source to share


No one has answered this question yet

Check out similar questions:

eleven
Meteorjs - Online Users
4
Nested Meteorjs Conditional Templates
4
Essential questions for MeteorJS
3
MeteorJS - fallback for disabled javascript?
2
Session scripts are hidden from user in MeteorJS?
2
Failed to call Meteor.call from client in MeteorJS?
2
meteorjs (CollectionFS) reads source of files
1
meteorjs how to insert handlebars_helpers into template
0
MeteorJS app not working after deploying to MeteorJS cloud
0
How to read a file client side in meteorjs?



All Articles
Loading...
X
Show
Funny
Dev
Pics