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

fastlz

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastlz

Bindings for the C library fastlz

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by114.29%
Maintainers
1
Weekly downloads
 
Created
Source

node-fastlz

This is the start of some bindings to FastLZ. FastLZ is an implementation of lz77 which may not get the best compression ratio, but is relatively CPU efficient.

status

This library is a work in progress. I'm releasing it as 1.0.0 because it is going into production. But it only supports synchronous compression at the moment. We'll be fleshing out the API as needed (decompression and async) but those will wait on us actually needing those capabilities.

These bindings have only been tested with Node.js 5.x and 6.x. If you need an older version of node, and that version is still supported by the node core team, patches are welcome to get it working.

usage

fastlz.compressSync(sourceBuffer, sourceDataLength) -> compressedBuffer

sourceBuffer is the data you want compressed. sourceDataLength is the length of the data starting at 0 in the sourceBuffer. compressedBuffer is a minimally sized buffer of the compressed data.

example

const fastlz = require('fastlz');

const dataToCompress = Buffer.from('this string is gunna be smaller!', 'utf8');
const compressedData = fastlz.compressSync(dataToCompress, dataToCompress.length);

license

These bindings are distributed as ISC, which is compatible with the MIT license of FastLZ. You can find both licenses in LICENSE.

Keywords

FAQs

Package last updated on 30 Jun 2016

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