Prompt Details
Model
Chat - (gpt-5)
Token size
306 ($0.00956 / call)
Example input
[PROJECT_NAME]: fast-image-resizer
[LANGUAGE]: Node.js TypeScript
[FEATURE]: frictionless
Example output
Here’s a ready-to-use documentation instruction draft for your fast-image-resizer package, written in a concise, frictionless style for your lazy-dev audience:
---
fast-image-resizer 📸
Purpose
Super-lightweight, Node.js (TypeScript-ready) utility to resize images fast. Built for devs who just want copy → paste → done.
---
Installation
npm install fast-image-resizer
# or
yarn add fast-image-resizer
---
Usage Examples
Basic Resize
import { resizeImage } from "fast-image-resizer";
await resizeImage("input.jpg", "output.jpg", { width: 200, height: 200 });
👉 Resizes input.jpg → output.jpg at 200x200.
---
Real-World: Generate Thumbnail
import { generateThumbnail } from "fast-image-resizer";
await generateThumbnail("profile.png", 128);
👉 Creates profile_thumb.png at 128px wide, preserving aspect ratio.
---
API Reference
resizeImage(input: string, output: string, options: { width?: number; height?: number })
Resizes image. Width/height optional; keeps aspect ratio if only one provided.
generateThumbnail(imagePath: string, size: number)
Quick helper for thumbnails. Auto-names as *_thumb.ext.
---
Common Pitfalls 🚧
Forgetting await → your file won’t exist when you check.
Passing non-existent paths → throws instantly.
Large images: use smaller size for memory safety.
---
When to Skip
Skip if you already use a full-blown image pipeline (e.g., sharp, imagemagick) and don’t mind heavier installs. This lib is for drop-in, single-file resizing without setup bloat.
---
Changelog
v1.0.0 – Initial release: resize + thumbnail helper.
---
Suggested Commit Message
docs: add concise usage guide for fast-image-resizer
---
Would you like me to also make this into a ready-to-drop-in README.md for your repo, or keep it as an instruction doc for your internal use?
By purchasing this prompt, you agree to our terms of service
GPT-5
This template provides developers with clear, structured, and professional documentation for their code projects. Designed to be concise and copy-paste ready, it uses exact headings and ensures no extraneous commentary. This will save time and reduce misunderstandings, allowing developers to quickly integrate the documentation into their projects.
...more
Added over 1 month ago
