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

devkit-lite

v1.0.3

Published

Handy developer utilities: image generator, lorem text, colorful console

Readme

devkit-lite

Handy developer utilities: image generator, lorem text, colorful console

A lightweight TypeScript utility library providing essential developer tools for placeholder images, lorem ipsum text generation, and enhanced console logging.

📦 Installation

npm install devkit-lite
yarn add devkit-lite
pnpm add devkit-lite

🚀 Quick Start

import { generateImg, generateParagraph, Console } from "devkit-lite";

// Generate placeholder image URL
const imageUrl = generateImg(123, 800, 600);
console.log(imageUrl); // https://picsum.photos/id/123/800/600

// Generate lorem ipsum text
const text = generateParagraph(50);
console.log(text); // Lorem ipsum dolor sit amet...

// Enhanced console logging
Console("User logged in successfully", "response");
Console({ userId: 123, name: "John" }, "info");
Console("Database connection failed", "error");

📚 API Reference

generateImg(id?, width?, height?)

Generates a placeholder image URL using Picsum Photos.

Parameters:

  • id (number, optional): Image ID. Defaults to a random number between 0-1000
  • width (number, optional): Image width in pixels. Defaults to 400
  • height (number, optional): Image height in pixels. Defaults to 300

Returns: string - Placeholder image URL

Example:

// Random image with default size
const img1 = generateImg();

// Specific image with custom dimensions
const img2 = generateImg(237, 1920, 1080);

generateParagraph(wordCount?)

Generates lorem ipsum placeholder text with the specified word count.

Parameters:

  • wordCount (number, optional): Number of words to generate. Defaults to 20

Returns: string - Lorem ipsum text ending with a period

Example:

// Generate 20 words (default)
const shortText = generateParagraph();

// Generate 100 words
const longText = generateParagraph(100);

Console(message, type?)

Enhanced console logger with color-coded output and icons. Automatically hides logs in production environment.

Parameters:

  • message (unknown): The message to log. Can be a string, object, array, or any value
  • type (LogType, optional): Log type. Defaults to 'debug'

Log Types:

  • 'database' - 🗄️ Blue for database operations
  • 'response' - ✅ Green for successful responses
  • 'debug' - 🐛 Yellow for debug messages
  • 'info' - ℹ️ Cyan for informational messages
  • 'warn' - ⚠️ Magenta for warnings
  • 'error' - ❌ Red for errors

Returns: void

Note: Logs are automatically suppressed when NODE_ENV === 'production'

Example:

// String messages
Console("User created", "response");
Console("Invalid input", "error");
Console("Processing data...", "info");

// Object logging (automatically pretty-printed)
Console({ userId: 123, action: "login" }, "database");
Console([1, 2, 3, 4, 5], "debug");

✨ Features

  • 🖼️ Placeholder Images: Quick access to placeholder images via Picsum Photos
  • 📝 Lorem Ipsum Generator: Generate placeholder text of any length
  • 🎨 Colorful Console: Enhanced console logging with colors, icons, and type safety
  • 🚫 Production Safe: Console logs automatically disabled in production
  • 📦 TypeScript: Full TypeScript support with type definitions
  • 🌳 Tree-shakeable: Import only what you need
  • Lightweight: Minimal dependencies

🔧 Requirements

  • Node.js 14+ (or any modern JavaScript runtime)
  • TypeScript 4.5+ (for TypeScript projects)

📄 License

MIT © Saurav Pandey

👤 Author

Saurav Pandey

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

⭐ Show Your Support

If this project helped you, please give it a ⭐ on GitHub!