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

exec-cute

v1.0.1

Published

Execute shell commands in Node.js with a clean, promise-based API, real-time streaming, and optional fun mode with emojis and colored output.

Readme

Exec-cute

Execute shell commands with enhanced alternatives to exec() and spawn(), offering a cleaner API, promise support, and optional fun mode.

GitHub: https://github.com/hrach347/exec-cute

Install

 npm install exec-cute

Usage

run() - alternative for exec()

import { run } from "exec-cute";

const { stdout, stderr, err } = await run("ls -la");
console.log("Output:", stdout);

✅ Why it’s better than exec()

  • Promise-based API - no callbacks or nested logic
  • Consistent return object - always returns { stdout, stderr, err }
  • Controlled error handling - errors don’t crash your flow, you handle them manually
  • Optional wait delay - delay execution before running the command

spawnProcess() - alternative for spawn()

import { spawnProcess } from "exec-cute";

const child = spawnProcess("ping 1.1.1.1");

child.onData((data, stdout, stderr) => {
  if (stdout) console.log("stdout:", data);
  if (stderr) console.error("stderr:", data);
});

✅ Why it’s better than spawn()

  • Cleaner API - run a full command string instead of splitting command and args manually
  • Single output handler - onData() receives stdout and stderr in one place
  • Less boilerplate - no need to manually attach child.stdout.on() and child.stderr.on()
  • Faster to write - fewer lines needed to get real-time command output
  • Readable code - command execution stays simple and easy to understand
  • Safer defaults - avoids common mistakes when working with spawn streams
  • Automatic Buffer handling - stdout/stderr Buffers are automatically converted to strings

Fun Mode

// creating a file
import { run, funMode } from "exec-cute";

funMode(true);

const { stdout } = await run("touch newFile.txt");  

// ╔═ exec-cute ════════════════════════════════════════════════════════════════╗
//   ✍️  Running: "touch newFile.txt" ✍️
// ╚════════════════════════════════════════════════════════════════════════════╝
// ✅ SUCCESS ✅

// removing a file
import { run, funMode } from "exec-cute";

funMode(true);

const { stdout } = await run("rm newFile.txt");  

// ╔═ exec-cute ════════════════════════════════════════════════════════════════╗
//   🔥  Running: "rm newFile.txt" 🔥
// ╚════════════════════════════════════════════════════════════════════════════╝
// ✅ SUCCESS ✅

funMode(true) // Enable
funMode(false) // Disable

Exec-cute makes Node.js shell commands cleaner, safer, and more reliable, while keeping the experience enjoyable with optional fun mode features like emojis, colored output, and banners. It still gives you full control over stdout, stderr, errors, and streaming data.


More run() examples

import { run } from "exec-cute";

// Run with delay
const { stdout: delayed } = await run("echo Delayed Command", { wait: 1000 });
console.log("Delayed output:", delayed);

// Handling errors without crashing
const { stdout, stderr, err } = await run("ls /nonexistent");
if (err) console.log("Caught error:", stderr);

// Chaining commands manually
const { stdout: first } = await run("echo First");
const { stdout: second } = await run(`echo Second after "${first.trim()}"`);
console.log(first.trim(), "->", second.trim());

More spawnProcess() examples

import { spawnProcess } from "exec-cute";

// Real-time streaming of a long-running command
const child = spawnProcess("ping -c 4 1.1.1.1");

child.onData((data, stdout, stderr) => {
  if (stdout) console.log("Live output:", data);
  if (stderr) console.error("Error output:", data);
});

// Run multiple commands at once
const listChild = spawnProcess("ls -la");
listChild.onData((data) => console.log("Listing:", data));

const dateChild = spawnProcess("date");
dateChild.onData((data) => console.log("Current time:", data));

License

  • MIT

Conclusion

Exec-cute makes running Node.js shell commands clean, reliable, and fun. Enjoy !