# d5ly

> Deflate compression library based WebAssembly

Latest version **1.2.3** (published 2020-11-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install d5ly
pnpm add d5ly
yarn add d5ly
bun add d5ly
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2020-11-21 |
| First published | 2020-07-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 166.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | 5ly |
| Maintainers | _5ly |
| Keywords | deflate, zlib, gzip, wasm, fastest, compression, react, NodeJS, JavaScript, pako |

## Links

- npm: https://www.npmjs.com/package/d5ly
- Repository: https://github.com/slavaguk2000/d5ly_npm
- Homepage: https://github.com/slavaguk2000/d5ly_npm#readme
- Issues: https://github.com/slavaguk2000/d5ly_npm/issues
- npm.io page: https://npm.io/package/d5ly

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.2.3 (latest) — 2020-11-21
- 1.2.2 — 2020-11-21
- 1.2.1 — 2020-11-20
- 1.2.0 — 2020-11-20
- 1.1.3 — 2020-11-14
- 1.1.2 — 2020-11-14
- 1.1.1 — 2020-11-13
- 1.1.0 — 2020-11-13
- 1.0.7 — 2020-07-27
- 1.0.6 — 2020-07-15
- 1.0.5 — 2020-07-15
- 1.0.4 — 2020-07-15
- 1.0.3 — 2020-07-15
- 1.0.2 — 2020-07-10
- 1.0.1 — 2020-07-10
- … 1 more at https://npm.io/package/d5ly/versions

## README

# D5LY - npm
# The fastest deflate compressor in npm

## Usage 

With [npm](https://npmjs.org/) installed, run:

    $ npm install d5ly

Then use:

For React:
```javascript
import d5ly from 'd5ly'
```

For NodeJS:
```javascript
d5ly = require('d5ly')
```

Then:

if you sure, that wasm already had time to initialize, you can only use:
```javascript
var sourceArray = new Uint8Array(1000000);
sourceArray[4] = 45;
sourceArray[9] = 32;
console.log(sourceArray);
var compressedArray = d5ly.deflateCompress(sourceArray);
console.log(compressedArray);
var decompressedArray = d5ly.deflateDecompress(compressedArray);
console.log(decompressedArray);
compressedArray = d5ly.zlibCompress(sourceArray);
console.log(compressedArray);
decompressedArray = d5ly.zlibDecompress(compressedArray);
console.log(decompressedArray);
compressedArray = d5ly.gzipCompress(sourceArray);
console.log(compressedArray);
decompressedArray = d5ly.gzipDecompress(compressedArray);
console.log(decompressedArray);
```

You can check, if the wasm have been intialized by function:
```javascript
d5ly.isInit();
```

If you don't sure, thst the wasm have been initialized, you should put your code into callback:
```javascript
d5ly.onInitAdd(()=> {
    console.log('start');
    var sourceArray = new Uint8Array(1000000);
    sourceArray[4] = 45;
    sourceArray[9] = 32;
    console.log(sourceArray);
    var compressedArray = d5ly.deflateCompress(sourceArray);
    console.log(compressedArray);
    var decompressedArray = d5ly.deflateDecompress(compressedArray);
    console.log(decompressedArray);
    compressedArray = d5ly.zlibCompress(sourceArray);
    console.log(compressedArray);
    decompressedArray = d5ly.zlibDecompress(compressedArray);
    console.log(decompressedArray);
    compressedArray = d5ly.gzipCompress(sourceArray);
    console.log(compressedArray);
    decompressedArray = d5ly.gzipDecompress(compressedArray);
    console.log(decompressedArray);
});
```



Speed test in compare with [pako](https://www.npmjs.com/package/pako) and [wasm-flate](https://www.npmjs.com/package/wasm-flate):
![Test](/image/test.jpg)

---
_Source: https://npm.io/package/d5ly · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
