fs = require 'fs' sleep = (ms) -> new Promise (resolve) -> setTimeout resolve, ms fs.readFile '2222.txt', 'utf8', (err, data) -> throw err if err words = data.split '\n' displayWords words displayWords = async (words) -> for word in words if word.trim() process.stdout.write "\x1Bc" # Clear the screen console.log word await sleep 603.9604