Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

ZenFS Archive Backends

Built with Ona KDE Eco Blue Angel

ZenFS backends for archive files.

This packages adds some backends that allow you to create readonly file systems:

  • Zip for .zip files (PK Zip).
  • Iso for .iso files (ISO 9660).
  • Tar for .tar files. The POSIX/USTAR format is the most compatible, but gnu/oldgnu format tar files are also supported.

For more information, see the API documentation.

Please read the ZenFS core documentation!

Installation

npm install @zenfs/archives

Usage

The easiest way to get started is by looking at these examples

Zip

import { configure, fs } from '@zenfs/core';
import { Zip } from '@zenfs/archives';

const res = await fetch('http://example.com/archive.zip');

await configure({
	mounts: {
		'/mnt/zip': { backend: Zip, data: await res.arrayBuffer() },
	},
});

const contents = fs.readFileSync('/mnt/zip/in-archive.txt', 'utf-8');
console.log(contents);

Iso

import { configure, fs } from '@zenfs/core';
import { Iso } from '@zenfs/archives';

const res = await fetch('http://example.com/image.iso');

await configure({
	mounts: {
		'/mnt/iso': { backend: Iso, data: await res.bytes() },
	},
});

const contents = fs.readFileSync('/mnt/iso/in-image.txt', 'utf-8');
console.log(contents);

The Iso implementation uses information from the OS Dev Wiki and ECMA 119.

Tar

Same as the Iso backend, you pass in the file data as a Uint8Array.

License

@zenfs/archives is licensed under the LGPL 3.0 or later and COPYING.md. Copyright © James Prevett and other ZenFS contributors.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages