{"id":25601400,"url":"https://github.com/magnusthor/demolishedcompressor","last_synced_at":"2026-03-01T04:08:20.844Z","repository":{"id":77765581,"uuid":"191748322","full_name":"MagnusThor/demolishedcompressor","owner":"MagnusThor","description":"demolishedcompressor pack's a .js file into a PNG image with an HTML payload. When opened in a browser, the HTML extracts and executes the javascript.","archived":false,"fork":false,"pushed_at":"2023-11-07T14:47:37.000Z","size":356,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-19T08:37:26.702Z","etag":null,"topics":["compression","compression-library","demoscene","javascript","png-compression","pnghtml","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MagnusThor.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-13T11:15:33.000Z","updated_at":"2024-09-18T20:06:39.000Z","dependencies_parsed_at":"2023-11-07T15:40:16.031Z","dependency_job_id":null,"html_url":"https://github.com/MagnusThor/demolishedcompressor","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":0.04166666666666663,"last_synced_commit":"1d51be2f4ae2a4b604c1c49e1f0fb7042e7bf665"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MagnusThor/demolishedcompressor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusThor%2Fdemolishedcompressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusThor%2Fdemolishedcompressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusThor%2Fdemolishedcompressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusThor%2Fdemolishedcompressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MagnusThor","download_url":"https://codeload.github.com/MagnusThor/demolishedcompressor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagnusThor%2Fdemolishedcompressor/sbom","scorecard":{"id":88803,"data":{"date":"2025-08-11","repo":{"name":"github.com/MagnusThor/demolishedcompressor","commit":"56c715a5c287d3573f2e4025048903475e869a68"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T07:28:46.872Z","repository_id":77765581,"created_at":"2025-08-15T07:28:46.872Z","updated_at":"2025-08-15T07:28:46.872Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29960235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compression","compression-library","demoscene","javascript","png-compression","pnghtml","typescript"],"created_at":"2025-02-21T15:54:26.030Z","updated_at":"2026-03-01T04:08:20.824Z","avatar_url":"https://github.com/MagnusThor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# demolishedCompressor\n\ndemolishedCompressor pack's a .js/json/text file into a PNG image with an optional HTML payload. \n\nThe default behavior is when a packed file opened in a browser the HTML is extracted and the javascript executes. This option (default) is designed to pack/compress 4k, 8k and 64k demos build using Javascript into one \"executable\".\n\nBy using the external/custom unpacker you can pack 1-n resources and take advantage of demolishedcompressor and its functionality.\n\n## Install\n\n    npm install demolishedcompressor\n\n## API\n\n### Compress/Pack ( Pngify )    \n\n    Pngify(src: string, dest: string, preHTML?: string, customScript?: string): Promise\u003cany\u003e\n\n### TypeScript definition \n\n    static Mjolnir(src: string, dest: string, map: any): Promise\u003cany\u003e;\n    static Pngify(src: string, dest: string, preHTML?: string, customScript?: string): Promise\u003cany\u003e;\n}\n\n\n### Decompress/Unpack\n\n#### Default (built-in unpack)\n\nDo not pass customScript\n\n#### Custom unpacker \n\nYour custom unpacker javascript must consist of a function named z() , this is called by default.\n\nHere follows an example\n\n    z = function() {\n\n    c = String.fromCharCode;\n    q = document.querySelector.bind(document);\n    i = q(\"img\");\n    x = q(\"#c\").getContext(\"2d\");\n    x.drawImage(q(\"img\"),0,0);\n    d = x.getImageData(0, 0, i.width, i.height).data;\n    b = [];\n    s = 1E6;\n    p = b.push.bind(b);    \n    l = function(a) {\n        var w = (a / d.length) * 100;\n        q(\"#p\").style.width = w + \"%\";\n        for (i = a; i \u003c a + s \u0026\u0026 i \u003c d.length; i += 4) p(c(d[i])), p(c(d[i + 1])), p(c(d[i + 2]));\n        a \u003c d.length ? setTimeout(function() {\n            l(a + s)\n        }, 100) : (s = b.join(\"\").replace(/\\\\0/g, \" \"), (0, eval)(s),q(\"#p\").style.display = \"h\")\n    };\n    l(0)\n    };\n\nsee example/compress-custom.ts for a complete example\n\n\n\n### Create an instance of unpacker\n\n     let instance = U.getInstance();\n\n### Unpack a file     \n    \n    instance.loadAndUpack(\"packedfile.png\",  (result) =\u003e {\n       \n       // deal with the unpacked result\n       // i.e JSON.parse, eval etc.  \n      });\n\n\n## Examples\n\n\n### How to compress a file that automatically unpacks and executes when opened\n\n     import { Compressor } from 'demolishedcompressor';\n    \n    \n    const html = '\u003cp\u003ereplace this with your html\u003c/p\u003e'\n\n    // packs foo.js into output.png.html\n    \n    Compressor.Pngify(\"foo.js\",\"output.png.html\",html,true);\n\n\n\nCompile and run the script \n\n### How to compress a file that will use external/custom unpacker\n\n\n    import { Compressor } from 'demolishedcompressor';\n    \n    // packs /tiny/rawsong.json into tiny.png\n    \n    let html = ``;\n\n    Compressor.Pngify(\"/tiny-efflux/rawsong.json\",\"/tiny-efflux/tiny.png\",html,false)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnusthor%2Fdemolishedcompressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnusthor%2Fdemolishedcompressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnusthor%2Fdemolishedcompressor/lists"}