iso9660-wasm
v0.1.0
Published
Work with ISO images in browser, powered by WASM Go
Readme
iso9660-wasm
A WebAssembly port of iso9660 library for working with ISO9660 (.iso) files.
Currently only writing ISO images is supported.
Warning! This port is experimental, API and functionality may change in future releases.
Install
npm install iso9660-wasm
yarn add iso9660-wasm
pnpm add iso9660-wasmExamples
Creating ISO file in browser
import { ISOWriter } from 'iso9660-wasm';
// Create iso writer instance
const iso = await ISOWriter.create();
// Add file to the iso
iso.addFile("test.txt", new TextEncoder().encode("Hello WebAssembly!"));
// Write image filesystem and get it as a Uint8Array
const image = await iso.write("DEMO_VOLUME"); // volume id
// Close the iso writer instance and free resources
iso.close();
// Download the image as a file
const blob = new Blob([image as Uint8Array<ArrayBuffer>], { type: "application/octet-stream" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = "image.iso";
a.click();
URL.revokeObjectURL(url);Also see complete example in demo folder.
References for the format:
- ECMA-119 1st edition (December 1986) (Web Archive link)
- ECMA-119 2nd edition (December 1987) (Web Archive link)
- ECMA-119 3rd edition (December 2017) (Web Archive link)
- ECMA-119 4th edition (June 2019) (Web Archive link)
- Rock Ridge Interchange Protocol (Web Archive link)
- System Use Sharing Protocol v1.12
TODO
- Implement reading ISO files (with Rockridge)
- Bring back Go tests from upstream repo and adapt them for afero fs
- Rewrite E2E test of WASM from slop placeholder
Licensing
Original package
iso9660 - https://github.com/kdomanski/iso9660
Copyright (c) 2019-2020, Kamil Domański and contributors
This project is licensed under the BSD-2-Clause License - see the LICENSE file for details.
This project includes spf13/afero library by Steve Francia licensed under the Apache License 2.0 which can be obtained from https://www.apache.org/licenses/LICENSE-2.0.txt
