Last active
April 20, 2024 07:09
-
-
Save sheepla/f942022b657ec645bb3bfd1526f76e79 to your computer and use it in GitHub Desktop.
Write text to stdout with BufWriter in Deno
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as bufio from "https://deno.land/std@0.101.0/io/bufio.ts"; | |
const buf = bufio.BufWriter.create(Deno.stdout); | |
const encoder = new TextEncoder() | |
buf.write(encoder.encode("The ")) | |
buf.write(encoder.encode("quick ")) | |
buf.write(encoder.encode("brown ")) | |
buf.write(encoder.encode("fox ")) | |
buf.write(encoder.encode("jumps ")) | |
buf.write(encoder.encode("over ")) | |
buf.write(encoder.encode("the ")) | |
buf.write(encoder.encode("lazy ")) | |
buf.write(encoder.encode("dog ")) | |
buf.write(encoder.encode("\n")) | |
await buf.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment