{"_id":"@asaoluelijah/getfavicon","name":"@asaoluelijah/getfavicon","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@asaoluelijah/getfavicon","version":"1.0.0","type":"module","main":"dist/index.cjs.js","module":"dist/index.esm.js","browser":"dist/index.umd.js","scripts":{"build":"rollup -c"},"keywords":["favicon","browser","node","url","scraping"],"author":{"name":"Asaolu Elijah","email":"asaoluelijah@gmail.com"},"license":"MIT","devDependencies":{"@rollup/plugin-commonjs":"^28.0.3","@rollup/plugin-node-resolve":"^16.0.1","rollup":"^4.40.2"},"repository":{"type":"git","url":"git+https://github.com/asaoluelijah/getfavicon.git"},"_id":"@asaoluelijah/getfavicon@1.0.0","description":"A simple utility to fetch favicons in both Node.js and browser environments. Automatically handles redirects, provides fallback support, and only returns valid image responses.","bugs":{"url":"https://github.com/asaoluelijah/getfavicon/issues"},"homepage":"https://github.com/asaoluelijah/getfavicon#readme","_nodeVersion":"22.13.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-2k+2NkHkT77PFNsbqMBkguJidaeiWJc37FCoJkyLKPchjpycf3CnFkH7197oqgEiNlPIEjfeADGYCDskwLnaXg==","shasum":"3149e56e9ef318f4dfea9383f844f7aab39d025b","tarball":"https://registry.npmjs.org/@asaoluelijah/getfavicon/-/getfavicon-1.0.0.tgz","fileCount":5,"unpackedSize":6345,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB+U9vW1VYwDZAJ8mzmWWYZdHzvuDGP8+jdNGGaarZ/wAiBsK4XVB2rn0pMviNMkmTxEv4DKZMdnxOvVaFW0pG2nhA=="}]},"_npmUser":{"name":"asaoluelijah","email":"asaoluelijah7@gmail.com"},"directories":{},"maintainers":[{"name":"asaoluelijah","email":"asaoluelijah7@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/getfavicon_1.0.0_1747145558416_0.643773924255755"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-13T14:12:38.349Z","1.0.0":"2025-05-13T14:12:38.602Z","modified":"2025-05-13T14:12:38.863Z"},"maintainers":[{"name":"asaoluelijah","email":"asaoluelijah7@gmail.com"}],"description":"A simple utility to fetch favicons in both Node.js and browser environments. Automatically handles redirects, provides fallback support, and only returns valid image responses.","homepage":"https://github.com/asaoluelijah/getfavicon#readme","keywords":["favicon","browser","node","url","scraping"],"repository":{"type":"git","url":"git+https://github.com/asaoluelijah/getfavicon.git"},"author":{"name":"Asaolu Elijah","email":"asaoluelijah@gmail.com"},"bugs":{"url":"https://github.com/asaoluelijah/getfavicon/issues"},"license":"MIT","readme":"# 📦 `getfavicon`\n\nA simple utility to fetch favicons in both Node.js and browser environments. Automatically handles redirects, provides fallback support, and only returns valid image responses.\n\n## Install\n\n```bash\nnpm install @asaoluelijah/getfavicon\n```\n\n## Usage\n\n### Basic Usage\n\n```javascript\nimport { getFavicon } from '@asaoluelijah/getfavicon';\n\nconst domain = 'example.com';\nconst fallback = '/images/default-favicon.png';\n\nconst faviconUrl = await getFavicon(domain, fallback);\n\nconsole.log('Favicon URL:', faviconUrl);\n```\n\n### (Optional) Save to Disk\n\nIn Node.js, you can provide an output path to download the .ico file:\n\n```javascript\nimport { getFavicon } from '@asaoluelijah/getfavicon';\n\nconst path = await getFavicon('example.com', 'fallback.png', './favicon.ico');\nconsole.log('Favicon saved at:', path);\n```\n\n### Browser Usage (no bundler)\n\n```html\n<script src=\"https://unpkg.com/@asaoluelijah/getfavicon/dist/index.umd.js\"></script>\n<script>\n  GetFavicon.getFavicon('example.com', '/fallback.png').then(function(url) {\n    const img = document.createElement('img');\n    img.src = url;\n    document.body.appendChild(img);\n  });\n</script>\n```\n\n## Examples\n\nSee /examples for more examples.\n\n## Features\n\n- Follows redirects (e.g. domain → www.domain)\n- Only returns valid image responses\n- Fallback if no favicon found\n- No dependencies\n- Works in browser + Node\n- Optional file saving in Node\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-040996594099d2fb2b979258f45517ff"}