https://github.com/sosukesuzuki/daolnwod
Download a image from the url.
https://github.com/sosukesuzuki/daolnwod
async http nodejs promise
Last synced: 12 months ago
JSON representation
Download a image from the url.
- Host: GitHub
- URL: https://github.com/sosukesuzuki/daolnwod
- Owner: sosukesuzuki
- License: mit
- Created: 2019-06-21T16:58:01.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T02:24:53.000Z (about 4 years ago)
- Last Synced: 2025-02-10T04:43:43.303Z (about 1 year ago)
- Topics: async, http, nodejs, promise
- Language: TypeScript
- Homepage:
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# daolnwod
[](https://circleci.com/gh/sosukesuzuki/daolnwod)
[](https://badge.fury.io/js/daolnwod)
[](https://github.com/prettier/prettier)
Download images from url.
## Installation
```sh
$ 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:
```js
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`. So, you can write like below:
```js
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