# to-ico-sync

> Convert PNG to ICO (synchronous)

Latest version **1.0.6** (published 2016-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install to-ico-sync
pnpm add to-ico-sync
yarn add to-ico-sync
bun add to-ico-sync
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2016-10-05 |
| First published | 2016-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gianluca Nitti |
| Maintainers | gianluca-nitti |
| Keywords | buffer, convert, ico, png, sync |

## Links

- npm: https://www.npmjs.com/package/to-ico-sync
- Repository: https://github.com/gianluca-nitti/to-ico-sync
- Homepage: https://github.com/gianluca-nitti/to-ico-sync#readme
- Issues: https://github.com/gianluca-nitti/to-ico-sync/issues
- npm.io page: https://npm.io/package/to-ico-sync

## Dependencies (1)

- [pngjs](https://npm.io/package/pngjs.md) ^3.0.0

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2016-10-05
- 1.0.5 — 2016-08-22

## README

# to-ico-sync [![Build Status](https://travis-ci.org/gianluca-nitti/to-ico-sync.svg?branch=master)](https://travis-ci.org/gianluca-nitti/to-ico-sync)

This is a fork of https://github.com/kevva/to-ico that uses a simple synchronous function instead of promises, useful for node-based cli scripts.

## Install

```
$ npm install --save to-ico-sync
```

## Usage

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

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

var buf = toIco(files);

fs.writeFileSync('favicon.ico', buf);

```


## API

### toIco(input)

#### input

Type: `array`

An array of PNG image buffers. The images must have a size of `16x16`, `24x24`, `32x32`, `48x48`, `64x64`, `128x128` or `256x256` and they must have an 8 bit per sample (channel) bit-depth (on Unix you can check this with the `file` command: RGB(A) is supported, while [colormap](https://en.wikipedia.org/wiki/Indexed_color) is not, because it's 8 bits per pixel instead of 8 bits per channel, which is 24 or 32 bits per pixel depending on the presence of the alpha channel). Also, interlaced PNGs aren't supported.
These are limitations in the underlying [pngjs](https://github.com/niegowski/node-pngjs#documentation) library. If you have a colormap PNG you can convert it to an RGB/RGBA PNG with commonly used image editing tools.


## License
MIT licensed. Copyright for portions of source code are held by Kevin Martensson as part of module [to-ico](https://www.npmjs.com/package/to-ico).

---
_Source: https://npm.io/package/to-ico-sync · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
