Coder Social home page Coder Social logo

axel-downloader's Introduction

Build Status Coverage Status license

axel-downloader

A node.js wrapper around axel downloader.

Installation

macOS
brew install axel
Ubuntu
sudo apt install axel
  • Install axel-downloader from npm:
yarn add axel-downloader
# or
npm i axel-downloader -S

Usage

import { Download } from 'axel-downloader';

const url = 'http://somewhere-something.xyz/some-file.abc';
const downloadPath = '/home/username/Downloads'; // OPTIONAL
const options = {
  connections: 32,
  maxSpeed: 6000, // KB
  userAgent: 'Axel Bot',
  headers: [{
    key: 'token',
    value: 'n0tS0f3'
  }]
}; // OPTIONAL

const download = new Download(url, downloadPath, options);
download.on('start', () => {
  console.log('Download Started!');
});
download.on('progress', data => {
  console.log('Progress', data);
});
download.on('error', err => {
  console.log('Error', err);
});
download.on('connection-finished', data => {
  console.log('Connection Finished', data);
});
download.on('finish', () => {
  console.log('Download Finished!');
});
download.on('stop', () => {
  console.log('Download Stopped!');
});
download.start();

Download class inherits from EventEmitter. You can listen on it for start, progress, error, connection-finished, finish, stop events.

More details will be added.

Tests

yarn test
# or
npm test

Ideas || Issues

Just create an issue and describe it. I'll check it ASAP!

Contribution

You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that. โค๏ธ

Remember to write a few tests if you can. ๐Ÿ”ง

License

Licensed under the MIT License.

axel-downloader's People

Contributors

mamal72 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

axel-downloader's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.