@pwa/manifest-icons

4.0.0 • Public • Published

pwa-manifest-icons

Generate icon images by Web Manifest icons property. size and location will be referenced as writing icon images

Install

npm install --save @pwa/manifest-icons

Usase

const manifestIcons = require('@pwa/manifest-icons');
const manifest = {
  ...defaultManifest
};

(() => {
  const manifest.icons = await manifestIcons({
    // path for source image
    src: path.resolve(process.cwd(). './assets/icon.png'),
    // using cached images
    cache: true,
    // root path for output icons
    output: './static/manifest/icons',
    // revamp icon path with publicPath, which will be returned after resize. if null, using
    // output path
    publicPath: '/static/manifest/icons/',
    // sizes for resizing, default is 192, 512
    sizes: [192, 512]
  });
})();

// or using sync APIs powered by https://github.com/ybogdanov/node-sync

const manifest.icons = manifestIcons.sync({
  ...
});

License

MIT @ Jimmy Moon

Readme

Keywords

none

Package Sidebar

Install

npm i @pwa/manifest-icons

Weekly Downloads

146

Version

4.0.0

License

MIT

Unpacked Size

4.9 kB

Total Files

4

Last publish

Collaborators

  • lukeed
  • ragingwind