Functions

f
agoInWords(milliseconds: number): string

How long ago, in the shortest true words: just now, 12s ago, 4m ago, 2h ago.

f
complete(
server: REPLServer,
names: CompletionCache,
line: string,
callback: CompleterCallback,
cwd?: string
): void

What TAB offers: dot commands on a line that starts with one, page identifiers everywhere else.

f
durationTone(milliseconds: number): Tone

Which tone a round trip wears. A tenth of a second is where a person starts to notice waiting, and a second is where they start doing something else.

f
formatPathDisplay(
file: string,
projectRoot: string
): string

A path as a person would say it: qunitx-cli/lib/repl/session.ts for something in this project, and the absolute path for anything outside it.

f
linesOf(source: NodeJS.ReadableStream): AsyncIterable<string>

The lines of source, ending when it does — including when it ended before anyone asked.

f
mutedSuggestionStyle(): string

The terminal escape sequence the GHOST SUGGESTION is drawn in — grey, so it reads as something offered rather than something typed.

f
pageGoneMessage(argv?: readonly string[]): string

What to SAY when the page has gone — the farewell, not the going.

f
printHeaders(
headers: ReadonlyMap<string, string>,
_palette: Theme
): string

A block of headers, one per line, with the names in the colour that means "this is what you came to find".

f
printRequest(
connection: HttpRequest,
palette: Theme
): string

Everything about one connection: what was sent, what came back, and the body.

f
printRequestLine(
connection: HttpRequest,
palette: Theme,
now: number
): string

One connection on one line, for a list of them: 2m ago #3 200 GET /api/users.

f
printStatus(
connection: HttpRequest,
palette: Theme
): string

The whole answer in one line: 200 OK · 101 bytes · 9ms | GET http://localhost:4000/api/users | #3.

f
printTarget(request: HttpRequest["request"]): string

What a request was for: GET http://localhost:4321/api/users.

f
renamedNamespaces(loaded: ReadonlyArray<readonly [string, readonly string[]]>): string[]

Preloads that did not get the name they asked for, and what they answer to instead.

f
replayableSource(lines: readonly string[]): string

The lines of a session worth replaying: everything typed, minus the shell escapes.

f
run(): Promise<number>

Runs qunitx repl: opens a browser page, then reads, evaluates and prints in it until the input ends. Resolves with the process exit code once everything is closed.

f
setupLineHighlighting(
server: REPLServer,
palette: Theme
): void

Paints the line AS IT IS TYPED, in the colours the theme gives each capture.

f
setupRightMarginPreview(
server: REPLServer,
session: ReplSession,
arg_2: PreviewRoom
): void

Shows what the line would come to, dimmed against the RIGHT MARGIN while it is still being typed.

f
setupSuggestionBehaviors(
server: REPLServer,
names?: CompletionCache,
cwd?: string
): () => string

zsh-style typeahead: the rest of the last matching line, greyed out after the cursor, Ctrl-F to take it.

f
shell(
command: string,
out: NodeJS.WritableStream,
cwd: string
): Promise<number>

Runs one shell command, streaming its output to the terminal as it arrives.

f
sizeTone(bytes: number): Tone

Which tone a body size wears. A terminal stops being comfortable around a hundred kilobytes and stops coping around a megabyte, so those are the two boundaries.

f
statusTone(status: number): Tone

Which tone a status wears — the one place the four classes are decided.

f
trimHistoryFile(
file: string,
history: readonly string[]
): void

Cuts the history file back to the history it is meant to hold.

f
userMeansYes(answer: string): boolean

How an answer to [Y/n] is read: Enter, or anything starting with y. Everything else is no.

f
whatToRun(edited: { text: string; saved: boolean; aborted: boolean; }): string

What an edit leaves to run: the buffer where it moved, and nothing where it did not.

f
withoutTerminalReports(chunk: Buffer): Buffer

The same bytes with the terminal's answers to ITSELF dropped: mouse and cursor-position reports.

f
withVimHistoryKeys(stdin: NodeJS.ReadStream): NodeJS.ReadStream

stdin, with Ctrl-K and Ctrl-J walking history — a NEW stream, which is what to read instead.