Skip to content

sosukesuzuki/daolnwod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

daolnwod

CircleCI npm version code style: prettier

Download images from url.

Installation

$ npm install --save daolnwod

Usage

If you want to download my icon image( https://avatars0.githubusercontent.com/u/14838850?s=460&v=4 ), you can write like below:

const daolnwod = reuqire("daolnwod");

daolnwod(
  "https://avatars0.githubusercontent.com/u/14838850?s=460&v=4",
  "./sosukesuzuki.jpg"
);

First argument is the image url you want to get. Second argument is the path you want to download the image to.

Also, daolnwod returns Promise<void>. So, you can write like below:

const daolnwod = reuqire("daolnwod");

daolnwod("https://avatars0.githubusercontent.com/u/14838850?s=460&v=4", "./sosukesuzuki.jpg")
  .then(() => {
    console.log("Successed");
  });
  .catch(error => {
    console.error("Failed");
  })

LICENSE

MIT