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

@sandro-sikic/maker

v1.1.0

Published

A lightweight library for building interactive command-line tools with prompts, command execution, spinners, and graceful shutdown handling

Readme

Maker

A lightweight library for building interactive command-line tools with ease.

npm version License: ISC

Features

Simple API - Just 5 core functions to build powerful CLI tools
🎯 Interactive Prompts - Built-in support for user input via @inquirer/prompts
Command Execution - Run shell commands with streaming output
🎨 Beautiful Spinners - Visual feedback with ora
🛡️ Graceful Shutdown - Automatic cleanup on exit signals
📘 TypeScript Support - Full type definitions included

Installation

npm install @sandro-sikic/maker

Quick Start

import * as maker from '@sandro-sikic/maker';

// Initialize CLI environment
maker.init();

// Prompt user for input
const name = await maker.prompt.input({
	message: 'What is your project name?',
});

// Show progress with spinner
const loading = maker.spinner('Creating project...').start();

// Run shell commands
await maker.run(`mkdir ${name}`);
await maker.run(`cd ${name} && npm init -y`);

loading.succeed('Project created! 🎉');

API Overview

Core Functions

| Function | Description | | -------------------- | ------------------------------------------------------------------------------------------------------- | | init(opts?) | Validates interactive terminal environment; accepts optional options object ({ configPath?: string }) | | run(command, opts) | Executes shell commands with streaming output | | onExit(callback) | Registers cleanup function for graceful shutdown | | prompt.* | Interactive prompts (input, select, confirm, etc.) | | spinner(text) | Creates terminal loading indicators |

Example: Simple Build Tool

import * as maker from '@sandro-sikic/maker';

async function build() {
	maker.init();

	// Register cleanup
	maker.onExit(() => {
		console.log('Cleanup complete');
	});

	// Confirm action
	const shouldBuild = await maker.prompt.confirm({
		message: 'Start build?',
		default: true,
	});

	if (!shouldBuild) return;

	// Execute with spinner
	const building = maker.spinner('Building...').start();
	const result = await maker.run('npm run build');

	if (result.isError) {
		building.fail('Build failed!');
		process.exit(1);
	}

	building.succeed('Build complete!');
}

build();

Documentation

📖 Complete Usage Guide - Detailed documentation with examples
API Quick Reference - Fast lookup for all functions

API Details

init()

Initializes CLI environment and validates your process is running in an interactive terminal. Call first in your CLI app. Accepts an optional options object: { configPath?: string }.

// default
maker.init();

// override config file location
maker.init({ configPath: '/path/to/config.cfg' });

Note: passing a plain string to init() is not supported — use an options object instead.

run(command, opts)

Execute shell commands with real-time output streaming.

const result = await maker.run('npm test');

if (result.isError) {
	console.error('Command failed:', result.stderr);
}

Returns: { output, stdout, stderr, code, isError, error }

onExit(callback)

Register cleanup handlers for graceful shutdown (SIGINT, SIGTERM, SIGQUIT).

maker.onExit(async () => {
	await closeDatabase();
	await stopServer();
});

prompt.*

Interactive prompts powered by @inquirer/prompts:

await maker.prompt.input({ message: 'Name?' });
await maker.prompt.confirm({ message: 'Continue?' });
await maker.prompt.select({ message: 'Choose:', choices: [...] });
await maker.prompt.checkbox({ message: 'Select:', choices: [...] });
await maker.prompt.password({ message: 'API key:' });

spinner(text)

Create terminal spinners with ora:

const s = maker.spinner('Loading...').start();
s.succeed('Done!'); // ✔
s.fail('Failed!'); // ✖
s.warn('Warning!'); // ⚠
s.info('Info!'); // ℹ

Real-World Example

import * as maker from '@sandro-sikic/maker';

async function setupProject() {
	maker.init();

	// Get project configuration
	const config = {
		name: await maker.prompt.input({
			message: 'Project name:',
		}),
		framework: await maker.prompt.select({
			message: 'Framework:',
			choices: [
				{ name: 'React', value: 'react' },
				{ name: 'Vue', value: 'vue' },
				{ name: 'Angular', value: 'angular' },
			],
		}),
		features: await maker.prompt.checkbox({
			message: 'Features:',
			choices: [
				{ name: 'TypeScript', value: 'typescript' },
				{ name: 'ESLint', value: 'eslint' },
				{ name: 'Testing', value: 'testing' },
			],
		}),
	};

	// Confirm setup
	const proceed = await maker.prompt.confirm({
		message: 'Create project?',
		default: true,
	});

	if (!proceed) {
		console.log('Cancelled');
		return;
	}

	// Setup with progress indicators
	const setup = maker.spinner('Creating project...').start();

	await maker.run(`mkdir ${config.name}`);
	setup.text = 'Installing dependencies...';
	await maker.run(`cd ${config.name} && npm init -y`);
	await maker.run(`cd ${config.name} && npm install ${config.framework}`);

	for (const feature of config.features) {
		setup.text = `Installing ${feature}...`;
		await maker.run(`cd ${config.name} && npm install ${feature}`);
	}

	setup.succeed('Project ready! 🚀');
	console.log(`\nNext:\n  cd ${config.name}\n  npm start`);
}

setupProject();

TypeScript

Full TypeScript support with included type definitions:

import { run, RunResult, Ora } from '@sandro-sikic/maker';

const result: RunResult = await run('echo "Hello"');
const spinner: Ora = maker.spinner('Loading...');

Repository

github.com/sandro-sikic/maker

License

ISC

Credits

Built with: