summaryrefslogtreecommitdiff
path: root/lib/internal/main/eval_stdin.js
blob: 2a2ef6d38a1fe8fea837bc7739fc66ce4edbaae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';

// Stdin is not a TTY, we will read it and execute it.

const {
  prepareMainThreadExecution
} = require('internal/bootstrap/pre_execution');

const {
  evalScript,
  readStdin
} = require('internal/process/execution');

prepareMainThreadExecution();
markBootstrapComplete();

readStdin((code) => {
  process._eval = code;
  evalScript('[stdin]', process._eval, process._breakFirstLine);
});