Install Deno, see https://deno.land/manual/getting_started/installation
Run ./sfz2sf.sh with the path of the SingleFileZ page as first parameter
Install Deno, see https://deno.land/manual/getting_started/installation
Run ./sfz2sf.sh with the path of the SingleFileZ page as first parameter
| import { extract } from "https://raw.githubusercontent.com/gildas-lormeau/single-filez-core/main/processors/compression/compression-extract.js"; | |
| import * as zip from "https://raw.githubusercontent.com/gildas-lormeau/zip.js/master/index.js"; | |
| globalThis.zip = zip; | |
| const { docContent } = await extract(new Blob([await Deno.readFile(Deno.args[0])]), { noBlobURL: true }); | |
| if (Deno.args[1]) { | |
| await Deno.writeTextFile(Deno.args[1], docContent); | |
| } else { | |
| console.log(docContent); | |
| } |
| #!/bin/sh | |
| if [ $# -eq 0 ]; then | |
| echo | |
| echo " Usage: $0 <INPUT FILE> [OUTPUT FILE]" | |
| echo | |
| echo " Transforms a page saved with SingleFileZ into a SingleFile page." | |
| echo | |
| echo " Arguments:" | |
| echo | |
| echo " INPUT FILE: path to a file containing a page saved with SingleFileZ" | |
| echo " OUTPUT FILE: path of the output file" | |
| echo | |
| exit 1 | |
| else | |
| deno run --allow-read --allow-write ./sfz2sf.js "$1" "$2" | |
| fi |
It expects SFZ with
.zip.htmlextension as input and save them as SF with.htmlextension with same filename, removing the option to give output filename. Also updating%1with%~1, as it was giving error with filenames having space, so latter fixes that.sfz2sf.bat
sfz2sf.js