Comparing version 0.2.8-beta.2 to 0.3.0-beta.0
@@ -710,3 +710,4 @@ type RpcVersion = '1.0' | '2.0'; | ||
declare const openAsync: (socket: Socket, secret?: string, onMessageError?: ((err: unknown) => void) | undefined) => Promise<Conn>; | ||
declare const close: (conn: Conn, code?: number, reason?: string) => void; | ||
declare const open: (socket: Socket, secret?: string, onMessageError?: ((err: unknown) => void) | undefined) => Promise<Conn>; | ||
declare const system: Readonly<ClientSystem>; | ||
@@ -999,2 +1000,2 @@ declare const aria2: Readonly<ClientAria2>; | ||
export { Aria2ChangePositionResultOk, Aria2ChangeUriResultOk, Aria2ClientGlobalOptionKey, Aria2ClientGlobalOptions, Aria2ClientInputOptionKey, Aria2ClientInputOptions, Aria2ClientNotification, Aria2ClientNotificationMethod, Aria2ClientNotificationParams, Aria2DownloadBitTorrentInfo, Aria2DownloadBitTorrentMode, Aria2DownloadBitTorrentStatus, Aria2DownloadGid, Aria2DownloadState, Aria2DownloadStatus, Aria2FileStatus, Aria2PeerInfo, Aria2PeersInfo, Aria2PositionHow, Aria2RpcHTTPUrl, Aria2RpcMethod, Aria2RpcWebSocketUrl, Aria2ServerGlobalStat, Aria2ServerInfo, Aria2ServerSessionInfo, Aria2ServerVersion, Aria2ServersInfo, Aria2ServersInfoItem, Aria2StringUtf8, Aria2SystemMulticallParams, Aria2UriStatus, Aria2UriStatusString, ClientAria2, ClientSystem, Conn, Disposable, ReadyState, RpcCall, RpcResult, Socket, aria2, createHTTP, createWebSocket, openAsync, raw, system }; | ||
export { Aria2ChangePositionResultOk, Aria2ChangeUriResultOk, Aria2ClientGlobalOptionKey, Aria2ClientGlobalOptions, Aria2ClientInputOptionKey, Aria2ClientInputOptions, Aria2ClientNotification, Aria2ClientNotificationMethod, Aria2ClientNotificationParams, Aria2DownloadBitTorrentInfo, Aria2DownloadBitTorrentMode, Aria2DownloadBitTorrentStatus, Aria2DownloadGid, Aria2DownloadState, Aria2DownloadStatus, Aria2FileStatus, Aria2PeerInfo, Aria2PeersInfo, Aria2PositionHow, Aria2RpcHTTPUrl, Aria2RpcMethod, Aria2RpcWebSocketUrl, Aria2ServerGlobalStat, Aria2ServerInfo, Aria2ServerSessionInfo, Aria2ServerVersion, Aria2ServersInfo, Aria2ServersInfoItem, Aria2StringUtf8, Aria2SystemMulticallParams, Aria2UriStatus, Aria2UriStatusString, ClientAria2, ClientSystem, Conn, Disposable, ReadyState, RpcCall, RpcResult, Socket, aria2, close, createHTTP, createWebSocket, open, raw, system }; |
{ | ||
"name": "maria2", | ||
"version": "0.2.8-beta.2", | ||
"version": "0.3.0-beta.0", | ||
"description": "Simple RPC Library for aria2", | ||
"type": "module", | ||
"keywords": [ | ||
@@ -31,3 +32,2 @@ "aria2", | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.mjs", | ||
@@ -37,3 +37,2 @@ "types": "./dist/index.d.ts" | ||
}, | ||
"main": "dist/index.cjs", | ||
"module": "dist/index.mjs", | ||
@@ -68,2 +67,5 @@ "types": "dist/index.d.ts", | ||
}, | ||
"engines": { | ||
"node": ">= 14.8.0" | ||
}, | ||
"scripts": { | ||
@@ -70,0 +72,0 @@ "build": "unbuild", |
@@ -19,2 +19,14 @@ # maria2 | ||
- If you are using Node.js, you have to install peer dependencies. | ||
```sh | ||
# For Node.js <16.7.0 | ||
pnpm i uuid | ||
# For Node.js * | ||
pnpm i ws | ||
# For Node.js <18.0.0 | ||
pnpm i cross-fetch | ||
``` | ||
- Start aria2 with rpc, example | ||
@@ -28,6 +40,9 @@ ```sh | ||
```ts | ||
import { openAsync, createWebSocket, aria2 } from 'maria2' | ||
import { open, aria2 } from 'maria2' | ||
const conn = await openAsync( | ||
createWebSocket('ws://localhost:6800/jsonrpc') | ||
const conn = await open( | ||
new WebSocket('ws://localhost:6800/jsonrpc') | ||
// import { createWebSocket } from 'maria2' | ||
// createWebSocket('ws://localhost:6800/jsonrpc') | ||
) | ||
@@ -40,5 +55,5 @@ | ||
```ts | ||
import { openAsync, createHTTP, aria2 } from 'maria2' | ||
import { open, createHTTP, aria2 } from 'maria2' | ||
const conn = await openAsync( | ||
const conn = await open( | ||
createHTTP('http://localhost:6800/jsonrpc') | ||
@@ -52,6 +67,6 @@ ) | ||
```ts | ||
import { openAsync, createWebSocket, system } from 'maria2' | ||
import { open, system } from 'maria2' | ||
const conn = await openAsync( | ||
createWebSocket('ws://localhost:6800/jsonrpc') | ||
const conn = await open( | ||
new WebSocket('ws://localhost:6800/jsonrpc') | ||
) | ||
@@ -69,5 +84,6 @@ | ||
## Thanks to | ||
[@yjl9903](https://github.com/yjl9903) | ||
- [XLor (@yjl9903)](https://github.com/yjl9903) | ||
- [L0serj3rry (@Cnotech)](https://github.com/Cnotech) | ||
## License | ||
MIT License © 2023 [Hydration](https://github.com/hydrati) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
84
0
Yes
55103
5
1016