Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.awfixer.me/llms.txt

Use this file to discover all available pages before exploring further.

Note — JSTime provides a browser- and Node.js-compatible console global. This page only documents JSTime-native APIs.
In JSTime, the console object can be used as an AsyncIterable to sequentially read lines from process.stdin.
for await (const line of console) {
  console.log(line);
}
This is useful for implementing interactive programs, like the following addition calculator.
console.log(`Let's add some numbers!`);
console.write(`Count: 0\n> `);

let count = 0;
for await (const line of console) {
  count += Number(line);
  console.write(`Count: ${count}\n> `);
}
To run the file:
$ jstime adder.ts
Let's add some numbers!
Count: 0
> 5
Count: 5
> 5
Count: 10
> 5
Count: 15