
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
A CLI tool to wrap long-running processes, chop output into segments, and send input to the wrapped process via IPC.
Install globally with pnpm:
pnpm add -g chopup
Or, to use directly with npx:
npx chopup run -- <command-to-wrap> [args...]
run subcommand (default).chopup now uses explicit subcommands: run (default), request-logs, and send-input.
run command)This is the default command if no other subcommand is specified.
chopup run [--log-dir <log-dir>] [--log-prefix <prefix>] -- <command-to-wrap> [args...]
# OR (since run is default):
chopup [--log-dir <log-dir>] [--log-prefix <prefix>] -- <command-to-wrap> [args...]
Example:
chopup run -- node my-interactive-app.js
# Or simply:
chopup -- node my-interactive-app.js
--log-dir <path>: Directory to store chopped log files (optional, defaults to a sanitized folder in the system temp dir, e.g., /tmp/chopup_<project>_<cmd>).--log-prefix <prefix>: Prefix for log file names (e.g., myapp-). Defaults to empty (timestamp only).--: Separator before the command to wrap.<command-to-wrap> [args...]: The command and arguments to run (e.g., node my-app.js).What happens:
chopup.chopup logs its own PID and the IPC socket path to its stdout:
[CHOPUP] PID: 12345
[CHOPUP] IPC socket: /tmp/chopup_12345.sock
(Note: The actual socket path might be different, check the output.)chopup commands (see below).Use the request-logs command:
chopup request-logs --socket <socket-path>
Example:
chopup request-logs --socket /tmp/chopup_12345.sock
--socket <socket-path>: The IPC socket path of the running chopup run instance (from its startup log output).What happens:
chopup run instance via its IPC socket.Use the send-input command:
chopup send-input --socket <socket-path> --input "<string-to-send>"
Log Suppression Note:
send-input, only the following will be printed to stdout:
INPUT_SENT (on success)INPUT_SEND_ERROR or INPUT_SEND_ERROR_NO_CHILD (on failure)Example:
Imagine my-interactive-app.js (from step 1) prompts "Are you sure? (y/n): ".
chopup send-input --socket /tmp/chopup_12345.sock --input "y\n"
--socket <socket-path>: The IPC socket path of the running chopup run instance.--input "<string-to-send>": The string to send to the wrapped process's stdin.
\n in your input string, e.g., "y\n" or "some text then enter\n".What happens:
chopup run instance via IPC.chopup is wrapping.send-input command will print a confirmation (e.g., INPUT_SENT) or an error message. No other logs will be printed.Start chopup run in one shell with an interactive script:
# interactive-script.js might be something like:
# process.stdout.write('Enter your name: ');
# process.stdin.once('data', (data) => { console.log(`Hello, ${data.toString().trim()}!`); process.exit(); });
chopup run -- node interactive-script.js
/tmp/chopup_12345.sock).From another shell, send input to the script:
chopup send-input --socket /tmp/chopup_12345.sock --input "Alice\n"
Observe interactive-script.js in the first shell receiving the input and completing.
From another shell, trigger a log chop:
chopup request-logs --socket /tmp/chopup_12345.sock
Check the log directory for segmented log files.
If you have chopup cloned locally:
Run/Wrap a process:
pnpm start -- run [--log-dir <log-dir>] [--log-prefix <prefix>] -- <command-to-wrap> [args...]
# Or (since run is default):
pnpm start -- [--log-dir <log-dir>] [--log-prefix <prefix>] -- <command-to-wrap> [args...]
Request Logs via IPC:
pnpm start -- request-logs --socket <socket-path>
Send Input via IPC:
pnpm start -- send-input --socket <socket-path> --input "<string-to-send>"
chopup request-logs --socket <path> command.chopup run instance's output.chopup run instance is still running.send-input.send-input, only INPUT_SENT, INPUT_SEND_ERROR, or INPUT_SEND_ERROR_NO_CHILD will be printed to stdout. Connection errors will be printed to stderr. All other logs are suppressed for this command.chopup run process has not exited before logs could be written.tree-kill or manually clean up.pnpm formatpnpm lintpnpm testpnpm build (creates dist/index.js)ISC
main trigger semantic-release:
NPM_TOKEN secret in repo settings.pnpm run release --dry-run
NPM_TOKEN in GitHub repo secrets for publish to work.publishConfig.access is set to public in package.json.FAQs
A tool to wrap long-running processes and chop their logs based on file changes.
We found that chopup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.