New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

naria2

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

naria2 - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

61

dist/index.d.ts

@@ -0,5 +1,7 @@

import * as maria2_index from 'maria2/index';
import { PartialDeep } from 'type-fest';
import { Conn, Socket, Aria2ServerVersion } from 'maria2';
import { Conn, Socket, Aria2ServerVersion, Aria2ServerGlobalStat } from 'maria2';
import { Aria2InputOptions } from '@naria2/options';
export * from '@naria2/options';
import { Emitter, Handler, WildcardHandler } from 'mitt';

@@ -21,2 +23,5 @@ interface ClientOptions {

}
interface DownloadOptions {
position?: number;
}
interface TorrentFile {

@@ -29,12 +34,56 @@ }

type Aria2MonitorEvents = {
'download.start': string;
'download.pause': string;
'download.stop': string;
'download.complete': string;
'bt.download.complete': string;
'download.error': string;
};
type GenericEventHandler = Handler<Aria2MonitorEvents[keyof Aria2MonitorEvents]> | WildcardHandler<Aria2MonitorEvents>;
declare class Aria2Monitor implements Pick<Emitter<Aria2MonitorEvents>, 'on' | 'off'> {
private _conn;
private disposables;
private emitter;
constructor(conn: Conn);
start(): Promise<void>;
close(): void;
watchStatus(gid: string): Promise<void>;
on<Key extends keyof Aria2MonitorEvents>(key: Key, handler: GenericEventHandler): void;
off<Key extends keyof Aria2MonitorEvents>(key: Key, handler?: GenericEventHandler): void;
private onDownloadStart;
private onDownloadPause;
private onDownloadStop;
private onDownloadComplete;
private onBtDownloadComplete;
private onDownloadError;
}
declare class Aria2Client {
private _conn;
private _monitor;
constructor(conn: Conn);
get conn(): Conn;
get socket(): Socket;
close(): Promise<void>;
get monitor(): Aria2Monitor;
close(): void;
/**
* This method shuts down aria2.
*
* @param force Call forceShutdown or shutdown
*/
shutdown(force?: boolean): Promise<void>;
/**
* This method returns the version of aria2 and the list of enabled features. The response is a struct and contains following keys.
*/
version(): Promise<Aria2ServerVersion>;
downloadMagnet(magnet: string, options?: PartialDeep<Aria2InputOptions>): Promise<void>;
downloadTorrent(torrent: string, options?: PartialDeep<Aria2InputOptions>): Promise<void>;
downloadUri(uris: string | string[], options?: PartialDeep<Aria2InputOptions>): Promise<void>;
/**
* This method returns global statistics such as the overall download and upload speeds. The response is a struct and contains the following keys. Values are strings.
*/
globalStat(): Promise<Aria2ServerGlobalStat>;
downloadTorrent(torrent: string, options?: PartialDeep<Aria2InputOptions> & DownloadOptions): Promise<void>;
downloadUri(uri: string | string[], options?: PartialDeep<Aria2InputOptions> & DownloadOptions): Promise<void>;
listActive(): Promise<maria2_index.Aria2DownloadStatus[]>;
listWaiting(offset: number, num: number): Promise<maria2_index.Aria2DownloadStatus[]>;
listStopped(offset: number, num: number): Promise<maria2_index.Aria2DownloadStatus[]>;
}

@@ -46,2 +95,2 @@ declare function createClient(_socket: Socket | Promise<Socket>, options?: ClientOptions): Promise<Aria2Client>;

export { Aria2Client, type ClientOptions, Torrent, type TorrentFile, type TorrentPiece, createClient };
export { Aria2Client, type ClientOptions, type DownloadOptions, Torrent, type TorrentFile, type TorrentPiece, createClient };

9

package.json
{
"name": "naria2",
"version": "0.0.11",
"version": "0.0.12",
"description": "High-level and Convenient BitTorrent Client based on aria2 JSON-RPC",

@@ -58,4 +58,5 @@ "keywords": [

"maria2": "^0.3.2",
"mitt": "^3.0.1",
"type-fest": "^4.6.0",
"@naria2/options": "0.0.11"
"@naria2/options": "0.0.12"
},

@@ -66,6 +67,6 @@ "devDependencies": {

"ws": "^8.14.2",
"@naria2/node": "0.0.11"
"@naria2/node": "0.0.12"
},
"peerDependencies": {
"@naria2/node": "0.0.11"
"@naria2/node": "0.0.12"
},

@@ -72,0 +73,0 @@ "peerDependenciesMeta": {

@@ -12,3 +12,3 @@ # naria2 (WIP)

## Usage
## Installation

@@ -15,0 +15,0 @@ ### Browser

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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