npm.io
2.0.8 • Published 9 years ago

switch-favicon

Licence
MIT
Version
2.0.8
Deps
2
Vulns
0
Weekly
0

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

npm install switch-favicon

usage

e.g. with React:

import { switchFavicon } from 'switch-favicon'

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

optional arguments

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

call like:

import { switchFavicon } from 'switch-favicon'

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

Keywords