4.0.0 • Published 5 years ago

@pwa/manifest-icons v4.0.0

Weekly downloads
1,593
License
MIT
Repository
github
Last release
5 years ago

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

4.0.0

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.1.0

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago