Skip to content

Commit

Permalink
wip: create templates/index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lumirlumir committed Dec 8, 2024
1 parent 505f067 commit 69ad5cd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/solutions-readline/templates/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* eslint-disable */
const { createInterface } = require('node:readline');
const { stdin: input, stdout: output } = require('node:process');
const { EOL } = require('node:os');
const { log } = require('node:console');

const rl = createInterface({ input, output });

let inputFile = '';

// eslint-disable-next-line no-shadow
function solution(inputFile) {
// Solution
}

rl.on('line', line => {
inputFile += `${line}${EOL}`;
}).on('close', () => {
solution(inputFile);
});

0 comments on commit 69ad5cd

Please sign in to comment.