npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tooee/ask

v0.7.3

Published

Terminal text input gathering

Readme

@tooee/ask

Terminal text input gathering.

Part of the Tooee monorepo. See the main repo for documentation.

Architecture

Three layers, each independently exported:

  • useAskEditor() — headless core. Owns editor state and registers all editing commands (vim motions, insert entries, submit/cancel/escape) on the nearest command surface. Returns a controller (programmatic text control: getText, setText, insertText, setCursorToEnd, submit, mode/setMode) and an editor view-model for <AskEditor/>.
  • <AskEditor/> / <AskPanel/> — presentational parts. AskEditor renders the themed textarea/input plus scrollbar; AskPanel is the bordered panel chrome with title, prompt, hints, statusRight, footer, and inset slots. buildAskHints(mode, { multiline, extra }) builds the default hint entries.
  • <Ask/> (fullscreen), <AskOverlay/> (embedded), launch() — thin assemblies of the core. AskOverlay additionally accepts commands (extra ActionDefinition[] on this surface), controllerRef, chrome pass-throughs, and children for nested overlays.

Composites that open a nested picker should wrap it in a modal CommandSurfaceProvider — while mounted it owns the keyboard, and every ask command plus editor focus suspends automatically; no when guards or pickerOpen props are needed.

The low-level vim helpers (handleEditBufferVimMotion, appendAtCursor, openLineAtCursor) are exported for non-React or custom hosts.

Promise-based dialog

useAskDialog() opens AskOverlay as a modal dialog on the host's overlay stack and resolves the result:

const ask = useAskDialog();

const value = await ask.open({ prompt: "Commit message" });
// string on submit, null on cancel/replacement/unmount

Each open() owns one overlay record (unique id per call — concurrent dialogs stack instead of replacing each other) and one owned modal command surface, so host commands suspend and the host's global mode is never touched. The promise settles exactly once. Options pass through to AskOverlay (title, multiline, defaultValue, placeholder, commands, controllerRef, and chrome slots). Dialog commands may open nested dialogs (for example a typed useChooseDialog() picker); the nested surface suspends the editor and focus, value, and local mode are restored when it settles. The host must render overlay content (AppLayout does; custom hosts render useCurrentOverlay()).

Reserved keys

Cursor mode: h j k l 0 $ w b g G i a o O q y Escape Enter Shift+Enter, arrows, home/end. Insert mode: Escape, the submit key(s).

Clipboard sequences in cursor mode are yy for the current line, yg for the whole buffer, and yv for the active editor selection. Consumers can disable the built-in copy command group when taking over those sequences.

Consumers extending with commands should avoid these; m, d, x, c, and ctrl-chords are free today. Future vim work (x, dd, counts) will claim more single letters — composites should prefer ctrl-chords or leader sequences for anything beyond one or two mnemonic keys.