UNPKG

bat2js

Version:
47 lines (35 loc) 974 B
#!/usr/bin/env node // -- START HEADER -- // DO NOT MODIFY. // This file is automatically generated by bat2js. // To modify the contents, edit the original .bat file and run bat2js again. // Compiled from: hello.bat // -- END HEADER -- const fs = require('fs'); const path = require('path'); const { spawn } = require('child_process'); const readline = require('readline'); // -- START FUNCTIONS -- // Make a waitForKeypress function function waitForKeypress(message) { const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); return new Promise((resolve) => { rl.question(message, () => { rl.close(); resolve(); }); }); } // -- END FUNCTIONS -- // -- START COMPILED CODE -- // Declare variables let hi = "Hello"; let world = "world!"; // Output text to the console console.log(`${hi} ${world}`); console.log(`Goodbye world!`); waitForKeypress(''); fs.appendFileSync('pause_msg.txt', 'Press Enter to continue...');