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

meganova

v0.3.0

Published

Official JavaScript SDK for MegaNova AI — Inference, Cloud Agents, and Agent SDK

Readme

MegaNova JavaScript SDK

Official JavaScript/TypeScript SDK for the MegaNova AI platform — inference, cloud agents, and more.

Installation

npm install meganova

Requires Node.js 18+ (uses native fetch).

Quick Start

Chat Completion

import { MegaNova } from "meganova";

const client = new MegaNova({ apiKey: "YOUR_API_KEY" });

const response = await client.chat.completions.create({
  messages: [
    { role: "system", content: "You are a helpful assistant." },
    { role: "user", content: "What is the capital of France?" },
  ],
  model: "meganova-ai/manta-flash-1.0",
});

console.log(response.choices[0].message.content);

Streaming

const stream = await client.chat.completions.create({
  messages: [{ role: "user", content: "Write a haiku about space." }],
  model: "meganova-ai/manta-flash-1.0",
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}

Cloud Agents

Chat with deployed MegaNova Studio agents using just an API key — no authentication setup required.

import { CloudAgent } from "meganova";

const agent = new CloudAgent({ apiKey: "agent_xxx..." });

// Get agent info
const info = await agent.info();
console.log(`${info.name}: ${info.welcome_message}`);

// Chat
const response = await agent.chat("Hello!");
console.log(response.response);

Multi-turn Conversation

const conv = agent.conversation();
const r1 = await conv.chat("I need help with my account");
const r2 = await conv.chat("My email is [email protected]");
// conversation_id is tracked automatically

Tool Confirmation

Some agents use tools (ticket creation, email, etc.) that require approval:

const conv = agent.conversation();
const response = await conv.chat("Create a support ticket for my login issue");

if (conv.pendingToolCall) {
  console.log(`Agent wants to: ${conv.pendingToolCall.description}`);
  const result = await conv.confirm(); // or conv.reject()
}

OpenAI-compatible Completions

// Non-streaming
const response = await agent.completions({
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);

// Streaming
const stream = await agent.completions({
  messages: [{ role: "user", content: "Tell me a story" }],
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}

Image Generation

const response = await client.images.generate({
  prompt: "A futuristic city skyline at sunset, digital art",
  model: "ByteDance/SeedDream-4-5",
  width: 1024,
  height: 1024,
});

// response.data[0].b64_json contains the base64-encoded image

Model Discovery

// List all models
const models = await client.models.list();

// List serverless models with pricing
const textModels = await client.serverless.listModels("text_generation");
for (const model of textModels.models) {
  console.log(`${model.model_name}: $${model.cost_per_1k_input}/1K input`);
}

// Image models
const imageModels = await client.serverless.listModels("text_to_image");

Supported Models

  • Text: meganova-ai/manta-mini-1.0, manta-flash-1.0, manta-pro-1.0, Qwen/Qwen3-235B-A22B-Instruct-2507
  • Image: ByteDance/SeedDream-4-5, black-forest-labs/FLUX.1-dev
  • Audio: Systran/faster-whisper-large-v3
  • Vision: Qwen/Qwen2.5-VL-7B-Instruct

Use client.serverless.listModels() for the full list with pricing.

Error Handling

import { MeganovaError, AuthenticationError, RateLimitError } from "meganova";

try {
  await client.chat.completions.create({ ... });
} catch (err) {
  if (err instanceof AuthenticationError) {
    console.error("Invalid API key");
  } else if (err instanceof RateLimitError) {
    console.error("Rate limited, retry later");
  } else if (err instanceof MeganovaError) {
    console.error(`API error (${err.status}): ${err.message}`);
  }
}

Configuration

const client = new MegaNova({
  apiKey: "YOUR_API_KEY",
  baseUrl: "https://api.meganova.ai/v1", // default
  timeout: 60000,  // ms, default 60s
  maxRetries: 2,   // default
});

Environment variable: set MEGANOVA_API_KEY and read it in your app.

Examples

See the examples/ directory for runnable scripts.

License

MIT