Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Mar 20, 2024
1 parent 5eed5aa commit acf992e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

[BrowserFS](https://github.com/browser-fs/core) backend for `iso` files.

Please read the BrowserFS documentation!
> [!IMPORTANT]
> Please read the BrowserFS core documentation!
## Backend

This package adds `IsoFS`, which allows you to create a *readonly* file system from a iso file.
This package adds the `Iso` backend, which allows you to create a _readonly_ file system from a iso file.

For more information, see the [API documentation](https://browser-fs.github.io/iso).

Expand All @@ -18,16 +19,18 @@ npm install @browserfs/iso

## Usage

> 🛈 The examples are written in ESM. If you are using CJS, you can `require` the package. If running in a browser you can add a script tag to your HTML pointing to the `browser.min.js` and use BrowserFS Iso via the global `BrowserFS_ISO` object.
> [!NOTE]
> The examples are written in ESM. If you are using CJS, you can `require` the package. If running in a browser you can add a script tag to your HTML pointing to the `browser.min.js` and use BrowserFS Iso via the global `BrowserFS_ISO` object.
```js
import { configure, fs } from '@browserfs/core';
import { IsoFS } from '@browserfs/iso';
import { Iso } from '@browserfs/iso';

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

await configure({ '/mnt/iso': { fs: 'IsoFS', options: { isoData } } });
await configure({
'/mnt/iso': { backend: Iso, isoData: await res.arrayBuffer() },
});

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

0 comments on commit acf992e

Please sign in to comment.