Skip to content

Instantly share code, notes, and snippets.

@nadoneves
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadoneves/6aabd77b3c6433c14861 to your computer and use it in GitHub Desktop.
Save nadoneves/6aabd77b3c6433c14861 to your computer and use it in GitHub Desktop.
var readline = require('readline');
// Criando objeto que instacia a pergunta
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
var r;
// Perguntando ao usuário qual o tipo do e-mail
rl.question("Qual o tipo do e-mail? Ex.: cameba, eletronicos, etc...", function(resposta) {
r = true;
/*
// Lendo o arquivo base para gerar o novo arquivo
fs.readFile('boilerplate.html', function (err, data) {
if (err) throw err;
// Gerando o novo arquivo
fs.writeFile('output/'+dia+ '-' + mes + '-' + ano + '-' + resposta +'.html', data, function(){
if (err) throw err;
});
});
*/
if(r)
{
// Perguntando ao usuário qual o tipo do e-mail
rl.question("New Question...", function(resposta) {
/*
// Lendo o arquivo base para gerar o novo arquivo
fs.readFile('boilerplate.html', function (err, data) {
if (err) throw err;
// Gerando o novo arquivo
fs.writeFile('output/'+dia+ '-' + mes + '-' + ano + '-' + resposta +'.html', data, function(){
if (err) throw err;
});
});
*/
rl.close();
process.stdin.destroy();
});
}
else
{
rl.close();
process.stdin.destroy();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment