mirror of
https://github.com/denoland/deno.git
synced 2025-02-21 12:53:05 -05:00

Closes https://github.com/denoland/deno_core/issues/648 Co-authored-by: Matt Mastracci <matthew@mastracci.com>
11 lines
226 B
JavaScript
11 lines
226 B
JavaScript
const { core } = Deno[Deno.internal];
|
|
const opPromise = core.read(Deno.stdin.rid, new Uint8Array(10));
|
|
core.unrefOpPromise(opPromise);
|
|
|
|
async function main() {
|
|
console.log(1);
|
|
await opPromise;
|
|
console.log(2);
|
|
}
|
|
|
|
main();
|