
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
JavaScript (Node.js and browsers) library for aria2, "The next generation download utility."
aria2.js controls aria2 via its JSON-RPC interface and supports WebSocket, HTTP and JSONP transports.
npm install aria2
var Aria2 = require('aria2');
or
<script src="node_modules/aria2/lib/index.js"></script>
var Aria2 = window.Aria2
var aria2 = new Aria2([options]);
default options are
{
host: 'localhost',
port: 6800,
secure: false,
secret: ''
}
Secret is optional and refers to --rpc-secret.
aria2.open()
opens the WebSocket connection.
aria2.onopen = function() {
console.log('aria2 open');
};
aria2.open();
aria2.close()
closes the WebSocket connection.
aria2.onclose = function() {
console.log('aria2 closed!');
};
aria2.close();
aria2.onsend()
is called everytime a message is being sent
aria2.onmessage()
is called everytime a message has been received.
aria2.onsend = function(m) {
console.log('aria2 OUT', m);
};
aria2.onmessage = function(m) {
console.log('aria2 IN', m);
};
For a complete listing see aria2 methods.
Note that if you have passed the secret option to aria2.js, it will be automatically added it to every request so there is no need to include it.
When sending a request to aria2, if the WebSocket is closed, aria2.js will use the HTTP transport.
For every aria2 methods you can use
aria2.getVersion([params,] function(err, res) {
console.log(err || res);
});
or
aria2.send('getVersion', [params,] function(err, res) {
console.log(err || res);
});
For a complete listing see aria2 notifications.
For every notifications you can bind a function.
aria2.onDownloadStart = function(gid) {
console.log(gid);
};
See example.js
npm install -g eslint mocha babel
npm test
See CONTRIBUTING.md
FAQs
Library and for aria2, "The next generation download utility."
The npm package aria2 receives a total of 245 weekly downloads. As such, aria2 popularity was classified as not popular.
We found that aria2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.