@naria2/node
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -5,3 +5,3 @@ import * as execa from 'execa'; | ||
import { SpawnOptionsWithoutStdio, ChildProcessWithoutNullStreams, SpawnOptionsWithStdioTuple, StdioPipe, ChildProcessByStdio, StdioNull, SpawnOptions, ChildProcess } from 'node:child_process'; | ||
export { C as ChildProcessOptions, a as ChildProcessSocket, R as ResolvedChildProcessOptions, c as createChildProcess } from './shared/node.1b460090.js'; | ||
export { C as ChildProcessOptions, a as ChildProcessSocket, R as ResolvedChildProcessOptions, c as createChildProcess } from './shared/node.87401953.js'; | ||
import 'maria2/conn-46b064ba'; | ||
@@ -8,0 +8,0 @@ import 'type-fest'; |
import * as http from 'http'; | ||
import { IncomingMessage, ServerResponse } from 'node:http'; | ||
import { a as ChildProcessSocket } from './shared/node.1b460090.js'; | ||
import { a as ChildProcessSocket } from './shared/node.87401953.js'; | ||
import 'maria2/conn-46b064ba'; | ||
@@ -5,0 +5,0 @@ import 'type-fest'; |
{ | ||
"name": "@naria2/node", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "Cross-platform wrapper of aria2", | ||
@@ -64,3 +64,3 @@ "keywords": [ | ||
"ws": "^8.14.2", | ||
"@naria2/options": "0.0.22" | ||
"@naria2/options": "0.0.23" | ||
}, | ||
@@ -74,8 +74,8 @@ "devDependencies": { | ||
"optionalDependencies": { | ||
"@naria2/linux-arm64": "0.1.0-beta.0", | ||
"@naria2/darwin-arm64": "0.1.0-beta.0", | ||
"@naria2/darwin-x64": "0.1.0-beta.0", | ||
"@naria2/win32-ia32": "0.1.0-beta.0", | ||
"@naria2/win32-x64": "0.1.0-beta.0", | ||
"@naria2/win32-ia32": "0.1.0-beta.0", | ||
"@naria2/darwin-x64": "0.1.0-beta.0", | ||
"@naria2/linux-x64": "0.1.0-beta.0" | ||
"@naria2/linux-x64": "0.1.0-beta.0", | ||
"@naria2/linux-arm64": "0.1.0-beta.0" | ||
}, | ||
@@ -82,0 +82,0 @@ "engines": { |
@@ -6,4 +6,7 @@ # @naria2/node | ||
Cross-platform wrapper of aria2 | ||
Cross-platform wrapper of aria2. | ||
+ Download aria2 according to your platform | ||
+ Web UI for aria2c (more features is working in progress) | ||
## Installation | ||
@@ -29,5 +32,30 @@ | ||
// Create a aria2 child process and initialize a client | ||
const client = await createClient(createChildProcess()) | ||
// Start downloading a magnet | ||
const torrent = await client.downloadUri('...') | ||
// Watch metadata progress | ||
await torrent.watch((torrent) => { | ||
console.log(`Downloading [MEATADATA]`) | ||
}) | ||
// Watch torrent progress | ||
await torrent.watchFollowedBy((torrent) => { | ||
console.log(`Downloading ${torrent.name}`) | ||
}) | ||
// Shutdown client | ||
await client.shutdown() | ||
``` | ||
Due to the implementation of [aria2](https://aria2.github.io/manual/en/html/index.html), the downloading progress of a magnet uri includes **two steps**: | ||
1. Download the torrent metadata which contains only a special file named `[METADATA]`; | ||
2. Download the torrent content itself. | ||
So that, in the above code, you should first wait for downloading metadata, and then wait for downloading the followed by task which is the torrent content itself. | ||
You can find an example using Node.js [here](https://github.com/yjl9903/naria2/blob/main/scripts/download.mjs). | ||
> **Warning** | ||
@@ -34,0 +62,0 @@ > |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
583887
2772
79
+ Added@naria2/options@0.0.23(transitive)
- Removed@naria2/options@0.0.22(transitive)
Updated@naria2/options@0.0.23