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

@elmoziml/multiyo

v1.2.0

Published

A provider-agnostic AI SDK for Node.js. Switch between Google Gemini and OpenAI easily with pre-built services for Moderation, Analysis, and more.

Readme

Multiyo.ai 🤖

Multiyo is a powerful, provider-agnostic AI SDK for Node.js.
It helps developers integrate AI services (like Content Moderation, Summarization, and Sentiment Analysis) without worrying about Prompt Engineering, messy API responses, or vendor lock-in.

Easily switch between Google Gemini and OpenAI with a single line of configuration.

✨ Key Features

  • Unified API: Write code once, run it with Google or OpenAI.
  • Strict JSON Outputs: No more Regex parsing! All services return clean, typed JSON objects.
  • Pre-engineered Prompts: Optimized system instructions for common tasks.
  • Lightweight: Uses Dynamic Imports to keep your project size small (loads SDKs only when needed).

📦 Installation

Install the package via npm:

npm i @elmoziml/multiyo

🔔 Note:

  • The Google Gemini SDK (@google/generative-ai) is installed automatically as a dependency.
  • If you plan to use OpenAI, you must install it manually:
    npm install openai

⚙️ Configuration

Multiyo works out-of-the-box with Google Gemini as the default provider. You don't need complex setup files; just use Environment Variables.

1. Set up Environment Variables

Create a .env file in your project root:

# Required for default usage
GEMINI_API_KEY=your_google_api_key_here

# Required only if you use OpenAI
OPENAI_API_KEY=your_openai_api_key_here

2. Basic Usage (Default: Google Gemini)

Initialize the service without arguments to use the default provider.

import Multiyo from '@elmoziml/multiyo';
import dotenv from 'dotenv';
dotenv.config();

const service = new Multiyo.Moderation(); 
// 🚀 Automatically connects to Google Gemini

3. Switching Providers (OpenAI)

To use a different provider, pass a configuration object:

const service = new Multiyo.Moderation({
  provider: 'openai'
});

🚀 Usage Examples

🛡️ Content Moderation

Check if a user comment is safe, toxic, or spam.

import Multiyo from '@elmoziml/multiyo';
async function checkComment() {
  const mod = new Multiyo.Moderation();
  
  try {
    const result = await mod.reviewComment("You are stupid and I hate you!");
    
    if (!result.isSafe) {
      console.log(`❌ Comment rejected: ${result.reason}`);
      console.log(`Category: ${result.category}`);
    } else {
      console.log("✅ Comment published.");
    }
  } catch (error) {
    console.error("AI Error:", error.message);
  }
}

checkComment();

Output Example:

{
  "isSafe": false,
  "reason": "Contains personal insults.",
  "category": "harassment"
}

📊 Text Analysis (Summarization & Sentiment)

Summarize long texts or detect emotions.

import Multiyo from '@elmoziml/multiyo';

async function analyzePost() {
  const analyzer = new Multiyo.Analysis(); // Default: Google

  const text = "I absolutely love this product! It changed my life completely, although it's a bit expensive.";

  // 1. Get Sentiment
  const sentiment = await analyzer.getSentiment(text);
  console.log("Sentiment:", sentiment); 
  // Output: { sentiment: "positive", score: 0.8 }

  // 2. Summarize
  const summary = await analyzer.summarize(text);
  console.log("Summary:", summary.summary);
}

📚 API Reference

ModerationService

| Method | Input | Returns | Description | | :--- | :--- | :--- | :--- | | reviewComment(text) | string | Promise<{ isSafe, reason, category }> | Analyzes text for toxicity/spam. |

AnalysisService

| Method | Input | Returns | Description | | :--- | :--- | :--- | :--- | | summarize(text) | string | Promise<{ summary, keyPoints[] }> | Summarizes text and extracts bullets. | | getSentiment(text) | string | Promise<{ sentiment, score }> | Detects positive/negative tone. |


🛠 Advanced Configuration

You can override specific settings (like the Model ID) for a specific instance.

const customService = new Multiyo.Analysis({
  provider: 'google',
  providers: {
    google: {
      model: 'gemini-1.5-pro' // Force specific model
    }
  }
});

📄 License

ISC