Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

icojs

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icojs

parse ico file

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by16.02%
Maintainers
1
Weekly downloads
 
Created
Source

icojs

Bower version npm version

Build Status Coverage Status Code Climate Dependency Status

A JavaScript library to use ICO.

Work on both Node.js and Browser.

var fs = require('fs');
var ICO = require('icojs');

var arrayBuffer = new Uint8Array(fs.readFileSync('favicon.ico')).buffer;
var images = ICO.parse(arrayBuffer);

Install

Node.js:

Prerequisite: icojs relies on node-canvas, and you must have installed cairo. Please see node-canvas wiki for installation instructions.

npm install icojs

Browser:

bower install icojs

And add to HTML:

<script type="text/javascript" src="/path/to/ico.js"></script>

To fully use this library, browsers must support JavaScript typed arrays and Canvas API.

Google Chrome, Internet Explorer 11, Mozilla Firefox and Safari 7.1 support these functions.

Demo

http://egy186.github.io/icojs/#demo

Documentation

ICO.parse

Parse ICO and return some PNGs.

Parameters
  • buffer ArrayBuffer - The ArrayBuffer object contain the TypedArray of a ICO file.
Returns
  • Array.<Object> - Array of parsed ICO.
    • width Number - Image width.
    • height Number - Image height.
    • bit Number - Image bit depth.
    • buffer ArrayBuffer - Image buffer.

ICO.isICO

Check the ArrayBuffer is valid ICO.

Parameters
  • buffer ArrayBuffer - The ArrayBuffer object contain the TypedArray of a ICO file.
Returns
  • Boolean - True if arg is ICO.

ICO.noConflict

No conflict.

Returns
  • ICO - ICO Object.

License

MIT license

Keywords

FAQs

Package last updated on 20 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc