MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / readStdin

Function readStdin

lib/command/query.js:196–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194}
195
196function readStdin() {
197 return new Promise((resolve, reject) => {
198 if (process.stdin.isTTY) {
199 resolve('')
200 return
201 }
202 let data = ''
203 process.stdin.setEncoding('utf8')
204 process.stdin.on('data', chunk => (data += chunk))
205 process.stdin.on('end', () => resolve(data))
206 process.stdin.on('error', reject)
207 })
208}
209
210function toArray(v) {
211 if (Array.isArray(v)) return v

Callers 1

queryFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…