Last active
April 8, 2026 03:09
-
-
Save greggman/c896e89d1a943aa8c590f88f97ad1f60 to your computer and use it in GitHub Desktop.
unrarit example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*bug-in-github-api-content-can-not-be-empty*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { unrar } from 'https://greggman.github.io/unrarit/dist/unrarit.module.js'; | |
| const {entries} = await unrar('https://greggman.github.io/unrarit/test/data/large.rar'); | |
| for (const [name, info] of Object.entries(entries)) { | |
| console.log(name); | |
| for (const [k, v] of Object.entries(info)) { | |
| console.log(' ', k, t(v)); | |
| } | |
| } | |
| console.log('---'); | |
| for (const [name, info] of Object.entries(entries)) { | |
| console.log(name); | |
| const blob = await info.blob(); | |
| const img = new Image(); | |
| img.src = URL.createObjectURL(blob); | |
| document.body.appendChild(img); | |
| } | |
| function t(v) { | |
| if (v && typeof v === 'object') { | |
| return v.constructor.name; | |
| } else { | |
| return typeof v; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"name":"unrarit example","settings":{},"filenames":["index.html","index.css","index.js"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment