DefinitelyTyped/types/gzip-js/gzip-js-tests.ts
2018-01-08 10:28:02 -08:00

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());