1.1.0 • Published 9 months ago

@zenfs/archives v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

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.

1.1.0

9 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

12 months ago

1.0.0

12 months ago

0.1.0

12 months ago

0.0.1

12 months ago