Created
April 8, 2020 18:52
-
-
Save pedrofracassi/485b8393f7bcf64fe8aae0bbea0070e2 to your computer and use it in GitHub Desktop.
Script usado pra formatar as respostas de um .txt pra tarefa "Cadê" da Ginconecta 2020.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const clipboardy = require('clipboardy'); | |
const fs = require('fs') | |
let last = '' | |
setInterval(() => { | |
fs.readFile('palavras.txt', 'utf8', function(err, data) { | |
const resposta = `Equipe: Oficina / Resposta: ${data.split('\r\n').map(w => w.charAt(0).toUpperCase() + w.slice(1)).sort().join(', ')}` | |
if (resposta !== last) { | |
last = resposta | |
clipboardy.writeSync(resposta) | |
console.log(resposta) | |
} | |
}); | |
}, 10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment