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

@volcengine/ark-runtime

v1.0.0

Published

Ark runtime data-plane client for model inference

Readme

@volcengine/ark-runtime

火山引擎方舟平台(Ark)Node.js SDK,快速接入大模型推理服务,支持豆包全系列模型。

为什么选择这个 SDK?

🚀 开箱即用:无需复杂配置,3行代码接入大模型 🎯 全功能覆盖:支持聊天、图像生成、视频生成、向量嵌入等所有能力 ⚡ 高性能:内置连接池、自动重试、超时控制,生产级稳定性 🔒 类型安全:完整 TypeScript 类型定义,开发体验优秀 🤝 跨语言对齐:与 Go SDK 100% API 兼容,多语言项目无切换成本

支持的功能

| 功能 | 支持 | 说明 | |------|------|------| | 聊天补全 | ✅ | 非流式/流式对话 | | 多模态对话 | ✅ | 支持图片输入 | | 函数调用 | ✅ | 工具调用、联网搜索 | | 嵌入向量 | ✅ | 文本嵌入、多模态嵌入 | | 图像生成 | ✅ | 文生图、图生图 | | 视频生成 | ✅ | 文生视频、图生视频 | | 内容生成 | ✅ | 音频生成、多模态生成 | | 批处理 | ✅ | 高并发批量请求 | | 文件管理 | ✅ | 知识库文件上传/管理 | | Bot 对话 | ✅ | 接入自定义 Bot | | 上下文对话 | ✅ | 持久化会话上下文 |

安装

npm install @volcengine/ark-runtime
# 或者
yarn add @volcengine/ark-runtime

快速开始

import { ArkRuntimeClient } from "@volcengine/ark-runtime";

// 初始化客户端
const client = new ArkRuntimeClient({
  apiKey: process.env.ARK_API_KEY || "your-api-key",
});

// 非流式聊天
async function chat() {
  const resp = await client.createChatCompletion({
    model: "doubao-seed-2-0-pro-260215",
    messages: [
      { role: "user", content: "2+3=?" }
    ],
  });
  console.log(resp.choices[0].message.content);
}

// 流式聊天
async function chatStream() {
  const stream = await client.createChatCompletionStream({
    model: "doubao-seed-2-0-pro-260215",
    messages: [
      { role: "user", content: "写一首关于春天的诗" }
    ],
  });

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

// 图像生成
async function generateImage() {
  const resp = await client.createImage({
    model: "doubao-seedream-5-0-260128",
    prompt: "一只可爱的小狗在公园里奔跑",
    n: 1,
    size: "1024x1024",
  });
  console.log(resp.data[0].url);
}

错误处理

SDK 提供统一的错误类:

  • ArkAPIError:API 返回的业务错误
  • ArkRequestError:网络请求错误
try {
  const resp = await client.createChatCompletion({ /* ... */ });
} catch (err) {
  if (err instanceof ArkAPIError) {
    console.log(`API 错误:${err.message}, 请求ID:${err.requestId}`);
    console.log(`HTTP 状态码:${err.httpStatusCode}`);
  } else if (err instanceof ArkRequestError) {
    console.log(`请求错误:${err.message}`);
  }
}

文档

  • 完整示例:参考 example 目录