# posthtml-inline-favicon
**Repository Path**: mirrors_posthtml/posthtml-inline-favicon
## Basic Information
- **Project Name**: posthtml-inline-favicon
- **Description**: PostHTML plugin to inline favicons
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-09-25
- **Last Updated**: 2025-09-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# posthtml-inline-favicon
[![NPM][npm]][npm-url]
`posthtml-inline-favicon` is a [PostHTML](https://github.com/posthtml/posthtml) plugin to inline favicons.
**Before:**
```html
```
**After:**
```html
```
## Install
```bash
# npm
npm i -D posthtml-inline-favicon
# pnpm
pnpm add -D posthtml-inline-favicon
# Yarn
yarn add -D posthtml-inline-favicon
```
## Usage
```js
const fs = require("fs");
const posthtml = require("posthtml");
const { inlineFavicon } = require("posthtml-inline-favicon");
const html = fs.readFileSync("./index.html");
posthtml()
.use(inlineFavicon())
.process(html)
.then((result) => fs.writeFileSync("./after.html", result.html));
```
## Options
By default, the plugin assumes that the file to process is in the same directory as the posthtml script. If not, specify the relative path to the html file in the options:
```js
const fs = require("fs");
const posthtml = require("posthtml");
const { inlineFavicon } = require("posthtml-inline-favicon");
const html = fs.readFileSync("./public/index.html");
posthtml()
.use(inlineFavicon({ path: "public" }))
.process(html)
.then((result) => fs.writeFileSync("./after.html", result.html));
```
## [Example](example)
## Contributing
See the [PostHTML Guidelines](https://github.com/posthtml/posthtml/tree/master/docs).
## [Changelog](CHANGELOG.md)
## License
[MIT](LICENSE)
[npm]: https://img.shields.io/npm/v/posthtml-inline-favicon.svg?color=blue
[npm-url]: https://npmjs.com/package/posthtml-inline-favicon