This package has been deprecated

Author message:

Use Pieroxy's lz-string library instead

lznext
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

lzString

LZ-based compression algorithm for JavaScript.

Note: This is a forked library of Pieroxy's lz-string library.

The library works in the same manner as Pieroxy's lz-string, except that this is a UMD build. The original library supported cjs, angular and requirejs. This on the other hand does not support angular. If you want to use it with angular, please continue reading below or click on the link above to download the original library instead.

This library comes with bug fixes which are not part of original library yet. If you still find any issues please feel free to log them.

install

$ npm install -g lznext

cjs:

const LZString = require('lznext');

es6:

import LZString from 'lznext';

es5:

<script src="lzString.min.js"></script>
<script>
LZString.compress('Hello World');
</script> 

angular 1:

angular.module('LZString', []).factory('LZString', () => LZString);

Usage

Compress:

LZString.compress('Hello World'); // Output: 〶惶@✰ӈ

De-compress:

LZstring.decompress('〶惶@✰ӈ'); // Output: Hello World

Local Storage friendly:

LZString.compressToUTF16('Hello World'); // Output: ɢ䰭䰾怤ݴ䂼怩䠠 

De-compress:

LZstring.decompressFromUTF16('ɢ䰭䰾怤ݴ䂼怩䠠 '); // Output: Hello World

For more details on available methods, please refer to the original documentation.

Readme

Keywords

Package Sidebar

Install

npm i lznext

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

250 kB

Total Files

28

Last publish

Collaborators

  • scssyworks