https://github.com/anubhavsrivastava/favicon-downloader
A module for downloading Favicon of any web site.
https://github.com/anubhavsrivastava/favicon-downloader
favicon favicon-downloader favicon-grabber
Last synced: 6 months ago
JSON representation
A module for downloading Favicon of any web site.
- Host: GitHub
- URL: https://github.com/anubhavsrivastava/favicon-downloader
- Owner: anubhavsrivastava
- License: mit
- Created: 2019-06-06T16:40:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T23:34:04.000Z (almost 3 years ago)
- Last Synced: 2025-04-14T15:15:10.014Z (6 months ago)
- Topics: favicon, favicon-downloader, favicon-grabber
- Language: JavaScript
- Homepage:
- Size: 838 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# favicon-downloader
> A module to download favicon of any site
[](https://travis-ci.org/anubhavsrivastava/favicon-downloader)
[](http://makeapullrequest.com)
[](https://github.com/anubhavsrivastava/favicon-downloader/issues)
[](http://hits.dwyl.io/anubhavsrivastava/favicon-downloader)[](https://nodei.co/npm/favicon-downloader/)
## Install
```
$ npm install favicon-downloader
```## Usage
```javascript
const { downloadIcons } = require('favicon-downloader');(async () => {
//downloads favicon set for specified URL
// By default downloads the icon to cwd
await downloadIcons('https://theanubhav.com');// Specify name to downloaded icon
await downloadIcons('https://devtips.theanubhav.com', { name: 'devtips.ico' });// Specify path to downloaded icons
await downloadIcons('https://about.theanubhav.com', { path: '/icons/about' });
})();
```## API
It uses the command [`favicongrab`](https://github.com/anubhavsrivastava/favicongrab) module to fetch the favicon and downloads them via `axios`
### downloadIcons(URL, options?)
Returns a promise for download action. Downloads all available favicons for the site.
#### URL
Type: `string`
Required:trueURL of the site whose favicon has to be downloaded
#### options?
Type: `object`
##### name
Type: `string`
Default: `` (empty)Name of the favicon file that will be downloaded. By Default it is filename that is mentioned in the target site.
##### path
Type: `string`
Default: `` (empty) (current working directory)Directory path where the favicons has to be downloaded. By default this is current working directory. If the path does not exists, directory is created.
### Related Module
- [favicon-downloader-cli](https://github.com/anubhavsrivastava/favicon-downloader-cli) CLI for this module
- [favicongrab](https://github.com/anubhavsrivastava/favicongrab) A module for fetching Favicon of any web site.### Contribution
Suggestions and PRs are welcome!
Please create issue or open PR request for contribution.
### License
[](LICENSE)
refer `LICENSE` file in this repository.