Socket
Book a DemoInstallSign in
Socket

maria2

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maria2

Simple and Light RPC Library for aria2

latest
Source
npmnpm
Version
0.4.1
Version published
Weekly downloads
1.4K
11.82%
Maintainers
1
Weekly downloads
 
Created
Source

maria2

Modern & Simple RPC Library for aria2.

Introduce

maria2 can control aria2c by its RPC interface.

Features

  • Simple and Light (Just 4.12KB after minified)
  • Better TypeScript IDE Support.
  • Browser and Node.js Support.

Getting Started

  • Install
bun i maria2

pnpm i maria2

yarn add maria2

npm i maria2
  • Run aria2c with RPC options, for example
aria2c --enable-rpc=true --rpc-listen-all=true --rpc-allow-origin-all=true --rpc-listen-port=6800
  • Connect by WebSocket
import { aria2, close, createWebSocket, open } from 'maria2'

const conn = await open(createWebSocket('ws://localhost:6800/jsonrpc'))

const version = await aria2.getVersion(conn)

console.log(version)

close(conn)
  • Connect by HTTP
import { aria2, close, createHTTP, open } from '.'

const conn = await open(createHTTP('ws://localhost:6800/jsonrpc'))

const version = await aria2.getVersion(conn)

console.log(version)

close(conn)
  • Multicall
import { close, open, system } from 'maria2'

const conn = await open(
  new WebSocket('ws://localhost:6800/jsonrpc')
)

// All typed
const [result0, result1] = await system.multicall({
  methodName: 'aria2.getVersion',
  params: []
}, {
  methodName: 'aria2.getGlobalStat',
  params: []
})

close(conn)

Credits

License

MIT License © 2023-present Hydration

Keywords

aria2

FAQs

Package last updated on 23 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts