1.4.2 • Published 7 years ago

pizza-guy v1.4.2

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

pizza-guy

Travis Codecov NPM Downloads Total Commitizen Friendly Semantic Released Join the chat at https://gitter.im/pizza-guy/Lobby

If you already have a big list of urls of files that you want to download but you don't know how, this is your module.

The idea is to support really big lists of files that would be insane to download simultaneously since Node would break for this kind of cases. Hope others to support this cause. ✌🏻

How to use

Require / Import

import pizzaGuy from 'pizza-guy';
// or
var pizzaGuy = require('pizza-guy');

Prepare your data

const images = [
  'http://some.domain.com/file0.jpg',
  'https://some.domain.com/file1.gif',
  'https://some.domain.com/file2.png'
];

or, if you want to alter the filenames on download...

const image = [
  { url: 'http://some.domain.com/file0.jpg', name: 'goat.jpg' },
  { url: 'http://some.domain.com/file1.gif', name: 'cat.gif' },
  { url: 'https://some.domain.com/file2.png', name: 'hawk.png' }
];

Execute

pizzaGuy
  // Pass an array of strings containing urls or an array of objects with urls and names...
  .deliver(images)
  // Absolute or relative path to save these files...
  .onAddress('./some-path')
  // Will trigger per file...
  .onSuccess((info) => {
    console.log(`${info.fileName} succeed!`);
  })
  // Will trigger per file that failed..
  .onError((info) => {
    console.log(`${info.fileName} failed`);
  })
  // Initialize the utility!
  .start();

Want a demo?

You can try out this module without any hassle. Just run npm run demo and you're all set. You can also run npm run demo:large if you want to try it with more files.

Demo files are located in demo/index.js and downloaded images will be located in demo/downloaded-images

How to contribute

This project is opened to everyone to contribute. If you want to, please read our GitHub issues and look for any that suits better to you. Also read about Commitizen Friendly and Semantic Released since the build is relying on these to test and publish automatically on NPM.

Please don't forget to run npm run demo before submitting any change just to double check that everything is working like a charm. We are expecting to have this as part of the testing suite but we are still working on it.

Please use npm run commit instead of git commit -m "your message" since we're using semantic release + commitizen and we aim to have things as tidy as possible.

Issues / bugs

We are working once on a while in this small library. Please report an issue here and we'll take a look as soon as we can.

1.4.2

7 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.1

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago