Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
It's a utility of zlib, gzip and zip format binary data.
chrome, firefox, Edge, safari, opera.
@type {string | number[] | ArrayBuffer | Uint8Array | Int8Array | Uint8ClampedArray}
jz.common.readFileAsArrayBuffer(blob).then(buffer => {
// ...
});
"UTF-8"
)jz.common.bytesToString(bytes).then(str => {
// ...
});
let concated = jz.common.concatBytes([bytes1, bytes2]);
// or
let concated = jz.common.concatBytes(bytes1, bytes2);
It loads files as Uint8Array
.
jz.common.load(['foo.png', 'bar.jpg']).then(([foo, bar]) => {
// ...
});
// or
jz.common.load('foo.png', 'bar.jpg').then(([foo, bar]) => {
// ...
});
6
, range is 0-9)0x8000
)0x8000
)6
)false
)0x8000
)jz.stream.core.deflate({
buffer: buffer,
streamFn: chunk => {
// ...
},
shareMemory: false,
});
false
)0x8000
)6
)0x8000
)0x8000
)6
)false
)0x8000
)false
)0x8000
)6
)0x8000
)0x8000
)6
)false
)0x8000
)false
)0x8000
)6
)0x8000
)var files = [
{
name: 'foo',
dir: [
// folder
{ name: 'hello.txt', buffer: 'Hello World!' }, // string
{ name: 'bar.js', buffer: buffer }, // ArrayBuffer
{ name: 'hoge.mp3', url: 'audiodata/hoge.mp3' }, // xhr
],
},
];
jz.zip
.pack({
files: files,
level: 5,
})
.then(buffer => {
// buffer is Uint8Array
});
// You cat set compression level to each files.
var files = [
{ name: 'mimetype', buffer: 'application/epub+zip', level: 0 }, //string
{
name: 'META-INF',
dir: [
//folder
{ name: 'container.xml', buffer: buffer, level: 0 }, //ArrayBuffer
],
},
{ name: 'package.opf', url: 'package.opf', level: 6 },
{ name: 'foo.xhtml', url: 'foo.xhtml', level: 9 }, //xhr
];
jz.zip.pack({ files }).then(buffer => {
// ...
});
"UTF-8"
)0x8000
)jz.zip
.unpack({
buffer: buffer,
encoding: 'Shift_JIS', // encoding of filenames
})
.then(reader => {
// reader is ZipArchiveReader. See below.
// get file names.
reader.getFileNames();
reader.readFileAsText(reader.getFileNames[0]).then(text => {
// ...
});
});
6
)false
)0x8000
)jz.stream.zip
.pack({
files: files,
streamFn: chunk => {
// ...
},
})
.then(() => {
// no args
});
It gets filenames in the zip archive.
Low level zip archive writer.
false
)0x8000
)const writer = new jz.zip.ZipArchiveWriter({ shareMemory: true, chunkSize: 0xf000 });
writer
.on('data', chunk => {
// chunk is Uint8Array.
})
.on('end', () => {
// ...
})
.write('foo/bar/baz.txt', buffer)
.write('a.mp3', mp3Buff)
.writeEnd();
Write the file. Directories are created automatically.
6
)writer.write('a/b/c/d/foo.txt', buffer, 7);
writer.writeDir('foo/');
// or
writer.writeDir('bar');
6
)writer.writeDir('a/');
writer.writeDir('a/b/');
writer.writeDir('a/b/c/');
writer.writeFile('a/b/c/foo.txt', buffer, 7);
Write central directory headers and the end central dirctory header.
writer.writeEnd();
You can import modules from subdirectries.
import { deflate } from "jsziptools/core";
import * as zip from "jsziptools/zip";
deflate(...);
zip.pack(...).then();
FAQs
It's a utility of zlib, gzip and zip format binary data.
The npm package jsziptools receives a total of 0 weekly downloads. As such, jsziptools popularity was classified as not popular.
We found that jsziptools demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.