node.js ile kullanıcıdan input alma

metinsama

Megapat
Katılım
7 Aralık 2014
Mesajlar
814
Çözümler
5
node.js ile kullanıcıdan veri almak istiyorum. Bunu nasıl yapabilirim?
 
Son düzenleyen: Moderatör:

JavaScript:
const readline = require("readline");
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

rl.question("What is your name? ", function(name) {
    rl.question("Where do you live? ", function(country) {
        console.log(`${name}, is a citizen of ${country}`);
        rl.close();
    });
});
 
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…