Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ahmadawais/get-online-img
๐ฅ Download an image by providing a URL and path in Node.js.
https://github.com/ahmadawais/get-online-img
Last synced: 26 days ago
JSON representation
๐ฅ Download an image by providing a URL and path in Node.js.
- Host: GitHub
- URL: https://github.com/ahmadawais/get-online-img
- Owner: ahmadawais
- License: mit
- Created: 2019-08-14T07:39:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-30T21:11:57.000Z (about 5 years ago)
- Last Synced: 2024-10-03T06:42:14.353Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 3.22 MB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license
- Code of conduct: code-of-conduct.md
Awesome Lists containing this project
README
# get-online-img
[![DOWNLOADS](https://img.shields.io/npm/dt/get-online-img?label=DOWNLOADS%20%20โฏ&colorA=6A788D&colorB=6A788D&style=flat)](https://www.npmjs.com/package/get-online-img) [![Learn VSCode](https://img.shields.io/badge/-VSCODE.pro%20%E2%86%92-gray.svg?colorB=6A788D&style=flat)](https://VSCode.pro/?utm_source=GitHubFOSS)
[![Follow @MrAhmadAwais on Twitter](https://img.shields.io/badge/FOLLOW%20@MRAHMADAWAIS%20%E2%86%92-gray.svg?colorA=6A788D&colorB=6A788D&style=flat)](https://twitter.com/mrahmadawais/)> ๐ฅ Download an image by providing a URL and path in Node.js.
[![๐](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/install.png)](./../../)
## Install
```sh
npm install get-online-img
```
[![โ๏ธ](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/usage.png)](./../../)
## Usage
```js
const downloadImg = require('get-online-img');// Download an image.
downloadImg(url, dest);
downloadImg('https://imgur.com/download/MyRQSXR/Cat%20Like%20A%20Boss!', './boss.gif');
```![demo](https://on.ahmda.ws/c28da1/c)
[![๐](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/options.png)](./../../)
## API
### downloadImg(url, dest);
#### โฏ url
Type: `string`
Direct URL to download an image.
#### โฏ dest
Type: `string`
Default: `./image.jpg`Download an image to this given destination path with the name and extension at the end of it. E.g. `./image.gif` will download the a gif type image from the given `url` to the root directory of where this script was run.
[![๐](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/log.png)](changelog.md)
## Changelog
[โฏ Read the changelog here โ](changelog.md)
**KEY**: `๐ฆ NEW`, `๐ IMPROVE`, `๐ FIX`, `๐ DOC`, `๐ RELEASE`, and `โ TEST`
> _I use [Emoji-log](https://github.com/ahmadawais/Emoji-Log), you should try it and simplify your git commits._
[![๐](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/license.png)](./../../)
## License & Conduct
- MIT ยฉ [Ahmad Awais](https://twitter.com/MrAhmadAwais/)
- [Code of Conduct](code-of-conduct.md)
[![๐](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/connect.png)](./../../)
## Connect
ย (follow) To stay up to date on free & open-source software
ย (follow) To get #OneDevMinute daily hot tips & trolls
ย (subscribe) To tech talks & #OneDevMinute videos
ย (read) In-depth & long form technical articles
ย (connect) On the LinkedIn profile y'all
[![๐](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/sponsor.png)](./../../)
## Sponsor
Me ([Ahmad Awais](https://twitter.com/mrahmadawais/)) and my incredible wife ([Maedah Batool](https://twitter.com/MaedahBatool/)) are two engineers who fell in love with open source and then with each other. You can read more [about me here](https://ahmadawais.com/about). If you or your company use any of my projects or like what Iโm doing then consider backing me. I'm in this for the long run. An open-source developer advocate.
- ๐ **$9.99/month (recommended)** โฏ [Two cups of Caffรจ latte (coffee) every month โ](https://pay.paddle.com/checkout/540217)
- ๐ **$99.99 (one-time sponsor)** โฏ [Support an hour of open-source code โ](https://pay.paddle.com/checkout/515568)
- ๐ฐ **$49.99 (one-time sponsor)** โฏ [Support an hour of maintenance โ](https://pay.paddle.com/checkout/527253)
- โ๏ธ **$9.99 (one-time sponsor)** โฏ [Lunch/coffee โ](https://pay.paddle.com/checkout/527254)
Or you can back me by checking out my super fun video course. As developers, we spend over 200 Hrs/month with our code editors โ it's only fair to learn your next editor deeply. This course will save you 15-20 hours every month. Become a VSCode Power User โ
[![VSCode](https://img.shields.io/badge/-VSCode.pro%20%E2%86%92-gray.svg?colorB=4D2AFF&style=flat)](https://VSCode.pro/?utm_source=GitHubFOSS)
[![Ahmad on Twitter](https://img.shields.io/twitter/follow/mrahmadawais.svg?style=social&label=Follow%20@MrAhmadAwais)](https://twitter.com/mrahmadawais/)