mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
12 lines
266 B
JavaScript
12 lines
266 B
JavaScript
|
const buffer = new Uint8Array(10);
|
||
|
const nread = await Deno.stdin.read(buffer);
|
||
|
|
||
|
if (nread != 10) {
|
||
|
throw new Error("Too little data read");
|
||
|
}
|
||
|
|
||
|
const nwritten = await Deno.stdout.write(buffer);
|
||
|
if (nwritten != 10) {
|
||
|
throw new Error("Too little data written");
|
||
|
}
|