simple-favicon-generator
v0.0.2
Published
Simple favicon generator.
Downloads
125
Maintainers
Readme
simple-favicon-generator
Simple favicon generator.
Install
npm install simple-favicon-generator
# or
yarn add simple-favicon-generator
If you are using M1 mac, you may fail to install sharp
, a library on which it depends.
This is not a fundamental solution, but you can use v14 of Node.js to make the installation succeed.
Usage
This is the simplest sample code.
Create a public
directory and then run it.
const generateFavicons = require('simple-favicon-generator');
(async () => {
const targetImage = './your-site-image.png';
const siteName = 'Your site name';
await generateFavicons(targetImage, siteName);
})();
If you want to specify the output directory, specify the third argument.
const generateFavicons = require('simple-favicon-generator');
(async () => {
const targetImage = './your-site-image.png';
const siteName = 'Your site name';
await generateFavicons(targetImage, siteName, 'output-dir');
})();
Development
# test
npm run test
# code format
npm run fmt