MCPcopy
hub / github.com/mongodb/node-mongodb-native / prompt

Function prompt

etc/docs/utils.ts:35–47  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

33export const log = (...args: any[]) => console.error(args);
34
35function prompt(prompt: string): Promise<string> {
36 const rl = createInterface({
37 input: process.stdin,
38 output: process.stderr
39 });
40
41 return new Promise((resolve, _) => {
42 rl.question(prompt, answer => {
43 rl.close();
44 resolve(answer.trim());
45 });
46 });
47}
48
49export async function confirm(message: string) {
50 const response = await prompt(message);

Callers 1

confirmFunction · 0.85

Calls 2

resolveFunction · 0.50
closeMethod · 0.45

Tested by

no test coverage detected