@zenfs/archives
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ZenFS Archive Backends

ZenFS backends for archive files.

This packages adds a few backends:

  • Zip allows you to create a readonly file system from a zip file.
  • Iso allows you to create a readonly file system from a .iso file.

For more information, see the API documentation.

Please read the ZenFS core documentation!

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: new Uint8Array(await res.arrayBuffer()) },
	},
});

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.

Readme

Keywords

Package Sidebar

Install

npm i @zenfs/archives

Weekly Downloads

163

Version

1.0.1

License

MIT

Unpacked Size

287 kB

Total Files

48

Last publish

Collaborators

  • james-pre