S
S
sidorikv2021-07-12 13:03:37
Node.js
sidorikv, 2021-07-12 13:03:37

How can I open a new terminal for code?

I welcome everyone!
For example, there is this piece of code:

const rl = readline.createInterface({
      input: process.stdin,
      output: process.stdout
    });

    async function input(prompt) {
      console.log(prompt);
      return (await rl[Symbol.asyncIterator]().next()).value;
    }

    async function code() {
      const code = await input("Код здесь: ");
      await frameCode.type("input[name='PASSWORD']", code);
      await frameCode.click("#btnSubmit", btn => btn.click());
      rl.close();
    }

    code();


This is where user interaction comes in. The user enters a code, and the code is passed to a variable. The variable is entered on the site.
But here's the problem, two threads can execute the same code. Imagine that two people are the same, and when the code needs to be entered for one and the second, then everything breaks down.
The question is simple: How can I open a new terminal for one thread / just open a new terminal for this piece of code?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question