JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 70516
  • Score
    100M100P100Q186726F
  • License MIT

Convert PNG to ICO in memory

Package Exports

  • to-ico

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (to-ico) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

to-ico Build Status

Convert PNG to ICO in memory

Install

$ npm install --save to-ico

Usage

const fs = require('fs');
const toIco = require('to-ico');

const files = [
    fs.readFileSync('unicorn-16x16.png'),
    fs.readFileSync('unicorn-32x32.png')
];

toIco(files).then(buf => {
    fs.writeFileSync('favicon.ico', buf);
});

API

toIco(input, [options])

input

Type: Array string

An array of PNG image buffers.

options

resize

Type: boolean
Default: false

Use the largest image and resize to sizes defined using the sizes option.

sizes

Type: Array
Default: [16, 24, 32, 48, 64, 128, 256]

Array of sizes to use when resizing.

License

MIT © Kevin Martensson