vite-plugin-naria2
Make it easy to debug a aria2 client application.
Installation
npm i naria2 @naria2/node vite-plugin-naria2
Usage
import { defineConfig } from 'vite';
import Naria2 from 'vite-plugin-naria2';
import TopLevelAwait from 'vite-plugin-top-level-await';
export default defineConfig({
plugins: [
TopLevelAwait(),
Naria2({
childProcess: {
log: './aria2.log',
environment: 'ignore',
rpc: {
secret: '123456'
}
}
})
]
});
Use the aria2 child process in your application code.
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