Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

maria2

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maria2

Simple RPC Library for aria2

  • 0.2.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
137
increased by107.58%
Maintainers
1
Weekly downloads
 
Created
Source

maria2

Modern & Simple RPC Library for aria2.

Introduce

maria2 can control aria2c by its RPC interface.

Features

  • Simple.
  • Better TypeScript IDE Support.
  • Browser and Node.js Support.

Example

  • Install this package
pnpm i maria2
  • Start aria2 with rpc, example
aria2c --enable-rpc=true --rpc-listen-all=true --rpc-allow-origin-all=true --rpc-listen-port=6800
  • Connect by WebSocket
import { openAsync, createWebSocket, aria2 } from 'maria2'

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

const version = await aria2.getVersion(conn)
  • Connect by HTTP
import { openAsync, createHTTP, aria2 } from 'maria2'

const conn = await openAsync(
  createHTTP('http://localhost:6800/jsonrpc')
)

const version = await aria2.getVersion(conn)
  • Multicall
import { openAsync, createWebSocket, system } from 'maria2'

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

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

Thanks to

@yjl9903

License

MIT License © 2023 Hydration

Keywords

FAQs

Package last updated on 11 Jul 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc