Getting values from Deno stdin

后端 未结 5 1103
梦毁少年i
梦毁少年i 2021-02-14 11:43

How can we get values from standard input in Deno?

I don\'t know how to use Deno.stdin.

An example would be appreciated.

5条回答
  •  被撕碎了的回忆
    2021-02-14 12:09

    I would suggest using the Input-Deno module. This is an example from the docs:

    // For a single question:
    const input = new InputLoop();
    const nodeName = await input.question('Enter the label for the node:');
            
    // output:
            
    // Enter the label for the node:
            
    // Return Value:
    // 'a'
    

提交回复
热议问题