Socket
Book a DemoInstallSign in
Socket

jszlib

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jszlib

deflate implemented in pure js.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

Build Status

jszlib

This provides an all js version of deflate. The goal is to provide a similar api to node's built in zlib. This provides a sync deflate that node native does not. Contributions welcome!

Example


var jszlib = require('jszlib'),
watcher = jszlib.deflate('aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbb',function(error,buffer){
  console.log(Buffer.toString('base64'));
});

install

npm install jszlib

argument structure

jszlib.deflate(buffer, [options], callback)

jszlib.deflateSync(buffer, [options]);

  • buffer

    • this can be a String or node Buffer object.
  • options.

    • right now no options need to be passed in from the outside.
  • callback

    • for non sync the buffer is passed as the data argument to the callback.

      callback(error,buffer)
      

thanks

most of the code is by imaya https://github.com/imaya/CanvasTool.PngEncoder who wrote a cool js png encoder. Thanks!! I ported this to node requires and updated the interface to be more nodey.

Keywords

js

FAQs

Package last updated on 07 Apr 2012

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