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

shmaker

v1.0.5

Published

A collection of essential utility functions by shailesh-04

Readme

shmaker npm npm GitHub GitHub issues GitHub pull requests

🔗 Package Link: shmaker

A developer-friendly CLI utility toolkit for automating repetitive tasks like generating migration files, folders, boilerplate code, and more. Built by and for developers who love speed, structure, and simplicity.


✨ Features

  • 📁 Generate migration files with timestamps
  • 🗂️ Create files and folders with one command
  • 🚀 Initialize project structure quickly
  • 🧰 Simple and extensible utility commands
  • 🖥️ Easy CLI usage without polluting your project code

📦 Installation

# Using npm
npm install shmaker

# or using yarn
yarn add shmaker

Color Utility

how to use this tool in any project with diffent versions

Quick Start

import { color, colorMulti, catchErr } from 'shmaker';

// Simple colored text
color('Hello World!', 'green');

// With additional styles
color('Important Message', ['red', 'bold', 'underline']);

// Multiple colored segments
colorMulti([
  ['Error: ', 'red', 'bold'],
  ['File not found', 'yellow'],
  [' at ', 'white'],
  ['/path/to/file', 'cyan', 'italic'],
]);

// Error handling with pretty output
try {
  // your code that might throw
} catch (error) {
  catchErr(error, '/path/to/script.js');
}

API Reference

color(value: any, appliedStyles?: ColorStyle | ColorStyle[])

Applies colors and styles to a single text value.

Parameters:

  • value: Any value (string, number, array, object) - will be converted to string
  • appliedStyles: Optional color style or array of styles

Example:

color('Success!', 'green');
color('Warning', ['yellow', 'bold']);
color({ data: 'test' }, 'cyan'); // Objects are JSON stringified

colorMulti(messages: ColorMessage[])

Applies different colors and styles to multiple text segments.

Parameters:

  • messages: Array of tuples [text, color?, styles?]

Example:

colorMulti([
  ['[', 'white'],
  ['ERROR', 'red', 'bold'],
  ['] ', 'white'],
  ['Something went wrong', 'yellow'],
]);

catchErr(err?: unknown, path?: string)

Pretty error logger with colored stack traces and formatted output.

Parameters:

  • err: Error object, string message, or any error value
  • path: Optional file path for context

Example:

try {
  riskyOperation();
} catch (error) {
  catchErr(error, __filename);
}

Available Styles

Text Colors:

  • Basic: black, red, green, yellow, blue, magenta, cyan, white
  • Bright: brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite

Background Colors:

  • Basic: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite
  • Bright: bgBrightBlack, bgBrightRed, bgBrightGreen, bgBrightYellow, bgBrightBlue, bgBrightMagenta, bgBrightCyan, bgBrightWhite

Text Styles:

  • reset, bold, dim, italic, underline, blink, inverse, hidden, strikethrough

Additional Utilities

random(min: number, max: number, decimals?: number): number

Generates random numbers within a range.

import { random } from 'shmaker';

random(1, 10); // Random integer between 1-10
random(0, 1, 2); // Random decimal with 2 places (0.00-1.00)

sleep(ms: number): Promise<void>

Async delay function.

import { sleep } from 'shmaker';

await sleep(1000); // Wait 1 second

TypeScript Support

Full TypeScript definitions included:

import type { ColorStyle, ColorMessage } from 'shmaker';

Basic Usage Old Versions

import { color } from 'shmaker';

// Simple colored text
color(['Hello World!', 'green']);

// With additional styles
color(['Important Message', 'red', ['bold', 'underline']]);

Available Options

Text Colors:

  • Basic: black, red, green, yellow, blue, magenta, cyan, white
  • Bright: brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite

Background Colors:

  • bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite
  • Bright variants available (e.g., bgBrightRed)

Text Styles:

  • bold, dim, italic, underline, blink, inverse, hidden, strikethrough

Advanced Examples

// Multiple styled segments
color(
  ['Error:', 'red', 'bold'],
  [' Something went wrong', 'yellow'],
  ['\nCode:', 'blue'],
  [' 404', 'white', 'inverse']
);

// Complex styling
color(
  ['Multi-style', 'magenta', ['bold', 'underline', 'blink']],
  [' with background', 'white', ['bgRed', 'dim']]
);

Error Formatting

import { catchErr } from 'shmaker';

try {
  // Your code that might throw errors
  throw new Error('Sample error message');
} catch (err) {
  catchErr(err, '/path/to/file.js');
}

Outputs formatted error messages with:

  • Red underlined header
  • Yellow error message
  • Blue inverted file path
  • Stack trace (if available)

License

MIT © Shailesh Makavana


Key improvements:

  1. Better organized documentation structure
  2. More practical usage examples
  3. Complete list of available options
  4. Clear error handling example
  5. Added development commands
  6. Professional formatting
  7. TypeScript/JavaScript import syntax
  8. Clear section separation

Would you like me to add any additional sections like:

  • API reference with all parameters
  • Contribution guidelines
  • Changelog section
  • More advanced usage examples?