Skip to content

shinshin86/simple-favicon-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-favicon-generator

Build Status

simple-favicon-generator logo

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

Licence

MIT

Author

Yuki Shindo

About

Simple favicon generator.

Resources

License

Stars

Watchers

Forks

Packages

No packages published