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

ai-replace-prompt

v1770195.248.27

Published

Professional integration for https://supermaker.ai/blog/best-ai-replace-prompts-to-transform-your-photos-instantly/

Readme

ai-replace-prompt

A lightweight JavaScript library for generating optimized AI replacement prompts based on user input. This utility helps streamline the creation of effective prompts for image editing and transformation tasks.

Installation

bash npm install ai-replace-prompt

Usage Examples

Here are several examples demonstrating how to use ai-replace-prompt in your JavaScript or Node.js projects:

Example 1: Basic Replacement javascript const { generatePrompt } = require('ai-replace-prompt');

const targetObject = "the sky"; const replacementObject = "a starry night";

const prompt = generatePrompt(targetObject, replacementObject); console.log(prompt); // Output: Replace the sky with a starry night.

Example 2: Adding Contextual Details javascript const { generatePrompt } = require('ai-replace-prompt');

const targetObject = "the car"; const replacementObject = "a futuristic hovercraft"; const context = "in a cyberpunk city";

const prompt = generatePrompt(targetObject, replacementObject, context); console.log(prompt); // Output: Replace the car with a futuristic hovercraft in a cyberpunk city.

Example 3: Specifying a Style javascript const { generatePrompt } = require('ai-replace-prompt');

const targetObject = "the portrait"; const replacementObject = "a painting in the style of Van Gogh";

const prompt = generatePrompt(targetObject, replacementObject); console.log(prompt); // Output: Replace the portrait with a painting in the style of Van Gogh.

Example 4: Using Advanced Options javascript const { generatePrompt } = require('ai-replace-prompt');

const targetObject = "the coffee cup"; const replacementObject = "a steaming mug of hot chocolate"; const context = "on a snowy windowsill"; const options = { strength: "high", detailLevel: "intricate" };

const prompt = generatePrompt(targetObject, replacementObject, context, options); console.log(prompt); // Output: Replace the coffee cup with a steaming mug of hot chocolate on a snowy windowsill. Strength: high, Detail Level: intricate.

Example 5: Handling Empty Context javascript const { generatePrompt } = require('ai-replace-prompt');

const targetObject = "the wall"; const replacementObject = "a mural"; const context = ""; // Empty context

const prompt = generatePrompt(targetObject, replacementObject, context); console.log(prompt); // Output: Replace the wall with a mural.

API Summary

generatePrompt(targetObject, replacementObject, context = "", options = {})

Generates an optimized AI replacement prompt string.

Parameters:

  • targetObject (string): The object to be replaced in the image.
  • replacementObject (string): The object that will replace the target object.
  • context (string, optional): Additional contextual information to refine the replacement. Defaults to "".
  • options (object, optional): An object containing additional options to control the prompt generation. Supported options include strength (string, e.g., "high", "medium", "low") and detailLevel (string, e.g., "intricate", "simple"). Defaults to {}.

Returns:

  • string: The generated AI replacement prompt.

License

MIT

This package is part of the ai-replace-prompt ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/blog/best-ai-replace-prompts-to-transform-your-photos-instantly/