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 🙏

© 2025 – Pkg Stats / Ryan Hefner

flowprompt

v1.0.5

Published

[![npm version](https://img.shields.io/npm/v/flowprompt.svg)](https://www.npmjs.com/package/flowprompt) [![npm downloads](https://img.shields.io/npm/dw/flowprompt)](https://www.npmjs.com/package/flowprompt)

Readme

flowprompt

npm version npm downloads

A Node.js terminal interface library for building rich interactive CLI applications. It provides a persistent prompt with managed logging output above. It's like REPL interfaces but has the benefit of output and input being evaulated separately which means you can input while output is generated. It is inspired by debugger interfaces like gdb.

Demo

view /examples/demo-example.js

Table of Contents

Key Features

  1. Persistent Prompt - Always-visible input area with custom prompt symbol
  2. Async-safe Logging - Write to output while waiting for user input without UI corruption
  3. Multi-line Log Control - Continue writing to the same output line or create new lines
  4. Piping Support - Supports piping into the output area
  5. Advanced Input Handling - Supports most important keys and key combinations:
    • History navigation (↑/↓ keys)
    • Advanced Cursor movement (←/→/Home/End/Ctrl+←/Ctrl+→)
    • ANSI escape sequence support
    • Ctrl+C handling (with double-tap exit)
  6. TypeScript Ready - Full type definitions included
  7. Dual Module Support - Works with both CommonJS (require) and ESM (import)

Installation

npm install flowprompt

Examples

TypeScript Example

import { Console } from 'flowprompt';

const vm = new Console({
    input: process.stdin,
    output: process.stdout,
    prompt: '-> ',
    encoding: 'utf8',
});

vm.log('Welcome to the VM Console!', true);

vm.on('line', (line: string) => {
    vm.log(`You typed: ${line}`, true);
});

view /examples/typescript-example.ts

Or run it using the following command:

npx tsx examples/typescript-example.ts

Asynchronous Output Example

const { Console } = require('flowprompt');

const vm = new Console({
    input: process.stdin,
    output: process.stdout,
    prompt: 'my-app> ',
    encoding: 'utf8'
});

setInterval(() => {
    vm.log(String.fromCodePoint(Math.floor(Math.random() * (0x5a - 0x41) + 0x41)), false);
},Math.random() * 1000)

vm.on("line", (line) => {
    vm.log(`Received: ${line}`);
})

view /examples/async-example.cjs

Or run it using the following command:

node examples/async-example.cjs

Debugger-like Interface Example

import { Console } from 'flowprompt';

const debuggerConsole = new Console({
    input: process.stdin,
    output: process.stdout,
    prompt: '(debugger) '
});

debuggerConsole.on('line', (cmd) => {
    switch (cmd) {
        case 'b':
        case 'breakpoints':
            debuggerConsole.log('Active breakpoints:\n- main.js:12\n- utils.js:45');
            break;
        case 'c':
        case 'continue':
            debuggerConsole.log('Resuming execution...');
            break;
        case 'h':
        case 'help':
        default:
            debuggerConsole.log('Available commands:\n- breakpoints (b)\n- continue (c)\n- help (h)');
            break;
    }
});

const completions = ['breakpoints', 'continue', 'help'];

debuggerConsole.on('autocomplete', ({line, pos, callback}) => {
    const lineEnd = line.slice(line.lastIndexOf(' ', pos - 1), pos)
    const hits = completions.filter((c) => c.startsWith(lineEnd)).map((c) => c.slice(lineEnd.length));
    const ccompletions = hits.map((hit) => ({line: `${line.slice(0, pos)}${hit}${line.slice(pos)}`, pos: pos + hit.length}))
    debuggerConsole.log(ccompletions.toString())
    callback(ccompletions);
})

view /examples/debugger-example.mjs

Or run it using the following command:

node examples/debugger-example.mjs

Contributing

Contributions are welcome! Create a pull request or open an issue to discuss a feature request or bug report. Have a look at TODO.md for planned features and improvements if you want to help out.