Coder Social home page Coder Social logo

lz4.js's Introduction

lz4.js

LZ4 for browser

Install and Use

bower

bower install lz4

html

<script src="bower_components/lz4/lz4.js"></script>

npm

npm install lz4-asm

npm global

npm install lz4-asm -g
lz4-asm -h

API

static values

  • lz4.BLOCK_MAX_SIZE_64KB
  • lz4.BLOCK_MAX_SIZE_256KB
  • lz4.BLOCK_MAX_SIZE_1MB
  • lz4.BLOCK_MAX_SIZE_4MB

lz4.compress(source, options)

compress to a lz4 buffer.

  • source Uint8Array | Buffer
  • options
    • compressionLevel number (range of 0-16, default is 0)
    • blockMaxSize number (lz4.BLOCK_MAX_SIZE_XX, default is lz4.BLOCK_MAX_SIZE_4MB)
    • blockIndependent boolean (default is false)
    • contentChecksum boolean (default is false)
  • return Uint8Array | Buffer

lz4.decompress(source)

decompress a lz4 buffer.

  • source Uint8Array | Buffer
  • return Uint8Array | Buffer

lz4.createCompressStream(options)

create a nodejs transform stream.

  • options
    • compressionLevel number (range of 0-16, default is 0)
    • blockMaxSize number (lz4.BLOCK_MAX_SIZE_XX, default is lz4.BLOCK_MAX_SIZE_4MB)
    • blockIndependent boolean (default is false)
    • contentChecksum boolean (default is false)

lz4.createDecompressStream()

create a nodejs transform stream.

Development

Require

  • latest emscripten
  • nodejs v5.0~

Init

Get repos.

git clone [email protected]:ukyo/lz4.js.git

If you don't install the grunt-cli run below.

npm install -g grunt-cli

Install dev dependencies

cd path/to/lz4.js
npm install

Download original LZ4 repos and compile for development.

grunt init

Write codes

Watch codes update and test.

grunt watch

Release

Release build.

grunt release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.