Skip to content

Instantly share code, notes, and snippets.

@PavanKu
Created January 26, 2022 14:52
Show Gist options
  • Select an option

  • Save PavanKu/e8454a759ea2b4aa5d48d3614f973b99 to your computer and use it in GitHub Desktop.

Select an option

Save PavanKu/e8454a759ea2b4aa5d48d3614f973b99 to your computer and use it in GitHub Desktop.

Revisions

  1. PavanKu created this gist Jan 26, 2022.
    11 changes: 11 additions & 0 deletions readConsole.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    process.stdin.resume();
    process.stdin.setEncoding("utf-8");
    let stdin_input = "";

    process.stdin.on("data", function (input) {
    stdin_input += input; // Reading input from STDIN
    });

    process.stdin.on("end", function () {
    main(stdin_input); // Calling function with input
    });