streaming 7-Zip archive extractor
0

Configure Feed

Select the types of activity you want to include in your feed.

TypeScript 99.9%
Other 0.1%
45 1 0

Clone this repository

https://git.vm.fail/mary.my.id/pkg-7zip https://git.vm.fail/did:plc:amt2ycxy6f7dcxb4krakulng
ssh://git@knot1.tangled.sh:2222/mary.my.id/pkg-7zip ssh://git@knot1.tangled.sh:2222/did:plc:amt2ycxy6f7dcxb4krakulng

For self-hosted knots, clone URLs may differ based on your setup.


README.md

7zip#

JSR | source code

streaming 7-Zip archive extractor

import { unsevenzip } from '@mary/7zip';
import { fromFsFile } from '@mary/7zip/deno';

// extracting a specific file from an archive
{
	using file = await Deno.open('./archive.7z');
	const reader = await fromFsFile(file);

	for await (const entry of unsevenzip(reader)) {
		console.log(entry.filename, entry.size);

		if (entry.filename === 'mod.ts') {
			console.log(await entry.text());
		}
	}
}

// password-protected, multi-volume archives — pass the volumes in order
{
	using v1 = await Deno.open('./archive.7z.001');
	using v2 = await Deno.open('./archive.7z.002');

	const readers = [await fromFsFile(v1), await fromFsFile(v2)];

	for await (const entry of unsevenzip(readers, { password: 'hunter2' })) {
		console.log(entry.filename, await entry.bytes());
	}
}