new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · all subjects

cli/prompting

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Browser globals: prompt(), confirm(), alert()

Deno ships the browser globals prompt(), confirm(), and alert() for simple interactive input. They block until the user responds, need no imports or permissions, and execution pauses at that line until input arrives.

@std/cli spinners, progress bars, and select prompts

The @std/cli module includes spinners, progress bars, and select prompts for fancier interactive input beyond simple prompt(), confirm(), and alert(). These live in modules prefixed with unstable-, so their APIs may still change.

Example: prompt, confirm, alert for interactive input

const name = prompt("Project name:", "my-app"); const ok = confirm(`Create ${name}?`); if (!ok) Deno.exit(1); console.log(`Creating ${name}...`);

Example: Spinner class from @std/cli

import { Spinner } from "jsr:@std/cli/unstable-spinner"; const spinner = new Spinner({ message: "Downloading..." }); spinner.start(); await new Promise((resolve) => setTimeout(resolve, 2000)); spinner.stop(); console.log("Done");

Permission error NotCapable requires --allow-read flag

The error 'NotCapable: Requires read access to ..., run again with the --allow-read flag' indicates Deno's permission sandbox is active. Grant the listed permission with -R or run with -A until ready to scope permissions down.

Give your agent this brain