mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
17 lines
403 B
TypeScript
17 lines
403 B
TypeScript
import * as gz from 'gzip-js';
|
|
|
|
const options = {
|
|
level: 3,
|
|
name: 'hello-world.txt',
|
|
timestamp: Date.now() / 1000,
|
|
};
|
|
|
|
const out = Buffer.from(gz.zip('Hello world', options));
|
|
console.log(out);
|
|
|
|
let buf;
|
|
buf = Buffer.from(gz.unzip([42, 42, 42]));
|
|
buf = Buffer.from(gz.unzip(Buffer.from([42, 42, 42])));
|
|
buf = Buffer.from(gz.unzip(new Uint8Array([42, 42, 42])));
|
|
console.log(buf.toString());
|