Risuko
Node.js API

Node.js API

Use the Risuko download engine from Node.js with native bindings.

risuko-js provides native Node.js bindings to the Risuko download engine via napi-rs. It ships as pre-built platform-specific binaries — no Rust toolchain needed.

Installation

npm install @risuko/risuko-js

Overview

The API is organized into six areas:

AreaFunctions
Engine LifecyclestartEngine, stopEngine
Task OperationsaddUri, addTorrent, addMagnet, addEd2k, addM3u8, addFtp, pause, unpause, remove, pauseAll, unpauseAll
QueriestellStatus, tellActive, tellWaiting, tellStopped, getGlobalStat, getFiles, getPeers, getUris
EventsonEvent
OptionsgetOption, getGlobalOption, changeOption, changeGlobalOption
SessionsaveSession, purgeDownloadResult, removeDownloadResult

Quick Example

import {
  startEngine,
  addUri,
  tellStatus,
  onEvent,
  stopEngine,
} from "@risuko/risuko-js";

await startEngine({ rpcPort: 16800 });

onEvent((event, gid) => {
  console.log(`[${event}] ${gid}`);
});

const gid = await addUri(
  ["https://example.com/file.zip"],
  { split: "16", dir: "/downloads" }
);

const status = await tellStatus(gid);
console.log(`Progress: ${status.completedLength}/${status.totalLength}`);

await stopEngine();

TypeScript Support

Full TypeScript declarations are included. All types are exported from the main module:

import type { EngineConfig, EngineEventName } from "@risuko/risuko-js";

On this page