# switch-favicon

> switch favicon according to hostname

Latest version **2.0.8** (published 2017-08-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install switch-favicon
pnpm add switch-favicon
yarn add switch-favicon
bun add switch-favicon
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.8 |
| Published | 2017-08-03 |
| First published | 2017-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Christian Zellweger |
| Maintainers | chzellweger |
| Keywords | favicon |

## Links

- npm: https://www.npmjs.com/package/switch-favicon
- Repository: https://gitlab.com/chzellweger/switch-favicon
- Homepage: https://gitlab.com/chzellweger/switch-favicon#README
- Issues: https://gitlab.com/chzellweger/switch-favicon/issues
- npm.io page: https://npm.io/package/switch-favicon

## Dependencies (2)

- [favicon-setter](https://npm.io/package/favicon-setter.md) ^0.1.1
- [@ta-interaktiv/parse-hostname](https://npm.io/package/@ta-interaktiv/parse-hostname.md) ^1.0.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [stockfish](https://npm.io/package/stockfish.md) — 27.0K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads

## Recent versions

- 2.0.8 (latest) — 2017-08-03
- 2.0.7 — 2017-08-02
- 2.0.6 — 2017-08-02
- 2.0.5 — 2017-07-30
- 2.0.4 — 2017-07-30
- 2.0.3 — 2017-07-30
- 2.0.2 — 2017-07-30
- 2.0.1 — 2017-07-30
- 2.0.0 — 2017-07-30

## README

# switch-favicon
Set the favicon according to the parsed sitename (``` http://www.[sitename].ch```). The module assumes the location of the favicon to be ```http://www.sitename.ch/favicon.ico``` but you can specify the pre- and the postfix as optional arguments.

## install
```bash
npm install switch-favicon
```

## usage
e.g. with React:

```js
import { switchFavicon } from 'switch-favicon'

...
componentDidMount() {
  switchFavicon()
}
...
```

## optional arguments


| Name | Type | Description | Default
| --- | --- | --- | ---|
| verbose | <code>String</code> | pass 'verbose' as first argument to log to the console | ```''```
| locPrefix | <code>String</code> | part of url to favicon before the parsed hostname| ```'http://www.'```
| locPostfix | <code>String</code> | part of url to favicon after the parsed hostname. | ```'.ch/favicon'```

call like: 
```js
import { switchFavicon } from 'switch-favicon'

switchFavicon('verbose', 'http://interaktiv.', '.ch/assets/favicon.ico')
```

---
_Source: https://npm.io/package/switch-favicon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
