0.0.25 • Published 4 months ago

vite-plugin-naria2 v0.0.25

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

vite-plugin-naria2

version CI

Make it easy to debug a aria2 client application.

Installation

npm i naria2 @naria2/node vite-plugin-naria2

Usage

// vite.config.ts

import { defineConfig } from 'vite';

import Naria2 from 'vite-plugin-naria2';
import TopLevelAwait from 'vite-plugin-top-level-await';

export default defineConfig({
  plugins: [
    TopLevelAwait(), // Used for transforming the top-level await syntax
    Naria2({
      childProcess: {
        log: './aria2.log',     // Used for debug
        environment: 'ignore',  // Ignore proxy environment variables
        rpc: {
          secret: '123456'      // Use the fixed secret, or generate under the hood
        }
      }
    })
  ]
});

Use the aria2 child process in your application code.

// main.ts

import { socket, client } from '~naria2/jsonrpc';

console.log('naria2 socket:', socket);
console.log('naria2 client:', client);

Warning

The aria2 child process only created in your development so that these exported variables will be undefined in production.

License

MIT License © 2023 XLor

0.0.25

4 months ago

0.0.20

7 months ago

0.0.21

7 months ago

0.0.22

7 months ago

0.0.11

7 months ago

0.0.23

7 months ago

0.0.12

7 months ago

0.0.24

6 months ago

0.0.13

7 months ago

0.0.14

7 months ago

0.0.15

7 months ago

0.0.16

7 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.19

7 months ago

0.0.10

8 months ago

0.0.9

8 months ago

0.0.9-beta.4

10 months ago

0.0.9-beta.3

10 months ago