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

promptai

v1.0.3

Published

Prompt-AI is a Python library that automates the process of generating AI-powered newsletters. It scrapes content from a given URL, generates a structured newsletter using Google's Gemini API, and provides features for parsing content, sending emails, and

Readme

Prompt-AI (Node.js)

Overview

Prompt-AI is a Node.js library that automates AI-powered newsletter generation. It scrapes content from a given URL, generates structured newsletters using Google's Gemini API, and provides features for parsing content, sending emails, and creating blog page links.

Features

  • AI Content Generation: Uses Google's Gemini API to generate newsletters based on scraped content.
  • Email Sending: Sends AI-generated newsletters via SMTP.
  • Blog Page Link Generation: Creates links for blog pages in both local and live environments.

Installation

npm install promptai axios nodemailer cheerio dotenv

Usage

1. Generate AI-Powered Newsletter

apiKey:

link:

  • Enter a reference link for which you want to generate a newsletter and blog article.
import { generateContent } from "promptai";

const apiKey = "your-google-gemini-api-key";
const title = "Latest Tech Trends";
const category = "Technology";
const link = "https://example.com/tech-news";

generateContent(title, category, link, apiKey)
  .then((newsletter) => console.log(newsletter))
  .catch((error) => console.error(error));

Response (Success):

{
  "title": "generated-title",
  "content": [
    {
      "subtitle": "generated-subtitle",
      "paragraph": "generated-inner-paragraph"
    }
  ],
  "tags": "generated tags for the blog",
  "category": "assigned category"
}

Response (Failed):

{
  "status": 203,
  "message": "Content not generated",
  "reason": "internal issue"
}

2. Send Newsletter via Email

SMTP Configuration

  • Update SMTP_SERVER and SMTP_PORT for your email provider.
  • Use an App Password for secure authentication.
import { sendEmail } from "promptai";

const receiverEmail = "[email protected]"; // Or ["comma-separated emails"]
const senderEmail = "[email protected]";
const emailAppPassword = "your-email-app-password";
const link = "generated-link-of-blog";
const title = "generated-title";
const description = "first-para-of-first-subtitle";
const subject = "Your-subject-here";

sendEmail(
  receiverEmail,
  senderEmail,
  emailAppPassword,
  link,
  title,
  description,
  subject
)
  .then((response) => console.log(response))
  .catch((error) => console.error(error));

Response (Success):

{ "status": 200, "message": "Email sent successfully" }

Response (Failed):

{
  "status": 203,
  "message": "Error in sending mail",
  "reason": "reason-of-error"
}

3. Create Blog Page Link

domainName:

  • Enter only the specific part of your domain name.
  • Examples:
    • Local: localhost:3000domain_name: localhost:3000
    • Live: https://example.comdomain_name: example.com

domainType:

  • "local": If using Prompt-AI on an unsecured network (localhost).
  • "live": For domains hosted on a secured network (https://your-domain.com).

title:

  • Use the same title that you received from generateContent.
import { createBlogPage } from "promptai";

const domainName = "yourwebsite.com";
const domainType = "live";
const title = "The Future of AI";

createBlogPage(title, domainType, domainName)
  .then((blogLink) => console.log(blogLink))
  .catch((error) => console.error(error));

Response (Success):

{
  "status": 200,
  "message": "Link generated",
  "link": "generated_link"
}

Response (Failed):

{
  "status": 203,
  "message": "Error generating link",
  "reason": "domain type not specified"
}

License

This project is licensed under the MIT License.

Contributions

Feel free to submit pull requests or report issues on GitHub.

Contact

For inquiries or support, reach out at [email protected].