Skip to content

io

Vara's library for handling input/output.

const io = require("@vara/io")

io.Write("hi |")
io.Write("hello |")
io.Write("こんにちは |")
io.Write("write directly to stdout\n") --// newlines automatically flush stdout

const lineRead = io.ReadLine()
io.Write(`read entire line: {lineRead}\n`)

const readBytes = 256
const lineRead = io.Read(readBytes)
io.Write(`read 256 bytes: {lineRead}\n`)

functions

Write -> ()

io.Write(message: string) : ()
Writes the string directly to stdout without flushing.

Read -> string

io.Read(chunkSize: number?) : string
Reads from stdin, with a optional chunkSize value for reading a certain ammount of bytes.

ReadLine -> string

io.ReadLine() : string
Reads stdin until it reaches a new line.