Le module readline
permet de lire ce qui est saisi au clavier.
Exemple
const readline = require('readline'),
fs = require('fs');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('Question ? ', answer => {
fs.appendFile('file.txt', answer, err => {
if (err) throw err;
console.log('The lyrics were updated!');
rl.close();
})
});