1const prompt = require('prompt-sync')();
2//You gotta download prompt-sync by doing npm i prompt-sync
3var time = prompt("Give time in seconds: ")
4time = parseInt(time)
5setInterval(function(){
6 console.log(time)
7 if(time = 0){
8 console.log("Time over")
9 }
10 else{
11 time = time - 1}
12}, 1000);