ZenFS backends for archive files.
This packages adds a few backends:
Zipallows you to create a readonly file system from a zip file.Isoallows you to create a readonly file system from a.isofile.
For more information, see the API documentation.
Please read the ZenFS core documentation!
Important
This project is licensed under the LGPL (v3+).
npm install @zenfs/archivesThe easiest way to get started is by looking at these examples
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);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.