{"id":18488129,"url":"https://github.com/jet2jet/resedit-js","last_synced_at":"2026-02-07T14:04:27.542Z","repository":{"id":37663986,"uuid":"161017775","full_name":"jet2jet/resedit-js","owner":"jet2jet","description":"JS library editing Windows Resource data","archived":false,"fork":false,"pushed_at":"2025-11-23T02:27:48.000Z","size":2492,"stargazers_count":43,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-23T04:17:44.595Z","etag":null,"topics":["authenticode","nodejs","pe-executable","resource","windows","winres"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jet2jet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-12-09T08:00:16.000Z","updated_at":"2025-11-23T02:27:44.000Z","dependencies_parsed_at":"2024-03-02T11:34:18.338Z","dependency_job_id":"8e038104-4d0a-44ea-821d-3ed1c4d1dbe7","html_url":"https://github.com/jet2jet/resedit-js","commit_stats":{"total_commits":209,"total_committers":3,"mean_commits":69.66666666666667,"dds":0.09090909090909094,"last_synced_commit":"5c945842d791a32efdd35aa9fac0e3f0ac2645b4"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/jet2jet/resedit-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fresedit-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fresedit-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fresedit-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fresedit-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jet2jet","download_url":"https://codeload.github.com/jet2jet/resedit-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fresedit-js/sbom","scorecard":{"id":516910,"data":{"date":"2025-08-11","repo":{"name":"github.com/jet2jet/resedit-js","commit":"82ef92750ecbfb32c927493a299df5f1e2d0273d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/11 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main-ci.yml:1","Info: no jobLevel write permissions found"],"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":"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":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Binary-Artifacts","score":0,"reason":"binaries present in source code","details":["Warn: binary detected: test/input/LoadIconApp_HasIcon/x64/LoadIconApp_HasIcon.exe:1","Warn: binary detected: test/input/LoadIconApp_HasIcon/x86/LoadIconApp_HasIcon.exe:1","Warn: binary detected: test/input/LoadIconApp_NoIcon/x64/LoadIconApp_NoIcon.exe:1","Warn: binary detected: test/input/LoadIconApp_NoIcon/x86/LoadIconApp_NoIcon.exe:1","Warn: binary detected: test/input/LoadIconApp_NoRes/x64/LoadIconApp_NoRes.exe:1","Warn: binary detected: test/input/LoadIconApp_NoRes/x86/LoadIconApp_NoRes.exe:1","Warn: binary detected: test/input/LoadStringApp_HasString/x64/LoadStringApp_HasString.exe:1","Warn: binary detected: test/input/LoadStringApp_HasString/x86/LoadStringApp_HasString.exe:1","Warn: binary detected: test/input/LoadStringApp_NoRes/x64/LoadStringApp_NoRes.exe:1","Warn: binary detected: test/input/LoadStringApp_NoRes/x86/LoadStringApp_NoRes.exe:1","Warn: binary detected: test/input/LoadStringApp_NoString/x64/LoadStringApp_NoString.exe:1","Warn: binary detected: test/input/LoadStringApp_NoString/x86/LoadStringApp_NoString.exe:1","Warn: binary detected: test/input/ReadVersionApp_HasVersion/x64/ReadVersionApp_HasVersion.exe:1","Warn: binary detected: test/input/ReadVersionApp_HasVersion/x86/ReadVersionApp_HasVersion.exe:1","Warn: binary detected: test/input/ReadVersionApp_NoRes/x64/ReadVersionApp_NoRes.exe:1","Warn: binary detected: test/input/ReadVersionApp_NoRes/x86/ReadVersionApp_NoRes.exe:1","Warn: binary detected: test/input/ReadVersionApp_NoVersion/x64/ReadVersionApp_NoVersion.exe:1","Warn: binary detected: test/input/ReadVersionApp_NoVersion/x86/ReadVersionApp_NoVersion.exe:1","Warn: binary detected: tools/VerifyTrust/x64/VerifyTrust.exe:1","Warn: binary detected: tools/VerifyTrust/x86/VerifyTrust.exe:1"],"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":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/jet2jet/resedit-js/main-ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jet2jet/resedit-js/main-ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/jet2jet/resedit-js/main-ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-ci.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/jet2jet/resedit-js/main-ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-ci.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/jet2jet/resedit-js/main-ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main-ci.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/jet2jet/resedit-js/main-ci.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main-ci.yml:22","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   2 npmCommand dependencies pinned"],"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":"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":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"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":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 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"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T02:04:25.725Z","repository_id":37663986,"created_at":"2025-08-20T02:04:25.725Z","updated_at":"2025-08-20T02:04:25.725Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28655390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["authenticode","nodejs","pe-executable","resource","windows","winres"],"created_at":"2024-11-06T12:51:18.482Z","updated_at":"2026-02-07T14:04:27.535Z","avatar_url":"https://github.com/jet2jet.png","language":"TypeScript","readme":"[![NPM Version](https://img.shields.io/npm/v/resedit)](https://www.npmjs.com/package/resedit)\n[![NPM Downloads](https://img.shields.io/npm/dw/resedit)](https://www.npmjs.com/package/resedit)\n[![Build Status](https://github.com/jet2jet/resedit-js/actions/workflows/main-ci.yml/badge.svg)](https://github.com/jet2jet/resedit-js)\n\n# resedit-js\n\nresedit-js is a library that manipulates resouces contained by Windows Executable files. All implementations are written in JavaScript (TypeScript), without using any native binaries. resedit-js works in both Node.js environment and Web environment.\n\nThis library is not tested well for modifying and/or signing executables yet. Please be careful with the emitted binaries.\n\nTo use from command line, [resedit-js-cli](https://www.npmjs.com/package/resedit-cli) is suitable.\n\nThe demo page: [resedit demo](https://www.pg-fl.jp/program/resedit/index.en.htm)\n\n- [Install](#install)\n- [Usage](#usage)\n- [Supported formats](#supported-formats)\n- [Parsing signed executables](#parsing-signed-executables)\n- [Signing executables with resedit-js](#signing-executables-with-resedit-js)\n- [Notes](#notes)\n- [Examples](#examples)\n- [License](#license)\n\n## Install\n\n```\nnpm install resedit\n```\n\n## Usage\n\n- For detailed code using `ResEdit` namespace, see [Examples](#examples).\n- For more APIs, please see `dist` directory of the package. And, [some test codes](./src/test) may help you for usages.\n\nFor ESM (ES Modules):\n\n```js\n//import * as PELibrary from 'pe-library';\nimport * as ResEdit from 'resedit';\n```\n\nFor CJS (CommonJS modules including classic Node.js scripts):\n\n```js\n//const PELibrary = require('pe-library');\nconst ResEdit = require('resedit');\n```\n\n\u003e If your Node.js version is prior to v20.19.5, `require` cannot be used for `'resedit'` package and you must use `'resedit/cjs'` package as described in [Migrate from v1.x to v2.x](#migrate-from-v1x-to-v2x) (collapsed in `Migration from prior resedit versions` area).\n\n\u003cdetails\u003e\u003csummary\u003eMigration from prior resedit versions\u003c/summary\u003e\n\n### Migrate from v2.x to v3.x\n\nThis major version up includes 'Change requirements of Node.js version (_v20.19.5 or later_ is required)' and 'Remove TypeScript enum usage' only. If your code base (project) meets following conditions, you can safely upgrade to v3.x (without no more actions):\n\n- You uses resedit v2.x\n  - If you use v1.x, please follow [Migrate from v1.x to v2.x](#migrate-from-v1x-to-v2x).\n- The code base already uses Node.js v20.19.5 or later (including v22, v24, or higher)\n  - Node.js v18 or earlier is already end-of-life. Upgrade to v22 or v24 is recommended.\n  - For using Node.js v20, upgrading to v20.19.5 or later would not be difficult.\n- Following enum's members are not used or used only as values: `VersionFileFlags`, `VersionFileOS`, `VersionFileDriverSubtype`, `VersionFileFontSubtype`, and `VersionFileType`\n  - If you use the members as types (e.g. `let x: VersionFileFlags.Debug`), rewrite with using `typeof` (e.g, `let x: typeof VersionFileFlags.Debug`).\n\n### Migrate from v1.x to v2.x\n\n- If you use from ES module (.mjs) and load by using `import`, no need for migration.\n- If you use from ES module (.mjs) and load by using `require` (Node.js: via `createRequire`), replace with `import` statement: `import * as ResEdit from 'resedit'`.\n- If you use from CommonJS module (.cjs) and load by using `require`, choose followings:\n  - If you are using under Node.js environment, _only_ update Node.js to v20.19.0 or later\n    - Starting from Node.js v20.19.0, you can `require` synchronous ES module. resedit does not use top-level `await`, so you can write `require('resedit')` from CommonJS module.\n  - Convert CommonJS module to ES module and replace `require` call with `import` statement\n  - Use `resedit/cjs` module and call `load` function (see below)\n- If you use TypeScript,\n  - For `\"module\": \"ES2015\"` or higher, no need for migration.\n  - For `\"module\": \"CommonJS\"`, import `resedit/cjs` and call `load` function\n\nThe sample of using `resedit/cjs` in CommonJS module is:\n\n```js\nconst { load } = require('resedit/cjs');\nload().then((ResEdit) =\u003e {\n  // ResEdit will be the namespace object of resedit library\n  // (for example ResEdit.Data.IconFile is available)\n});\n```\n\nSimilarly, the sample of using `resedit/cjs` in TypeScript CommonJS module is:\n\n```ts\n// You can use `ResEdit` for type references (cannot be used for value references)\nimport { type ResEdit, load } from 'resedit/cjs';\nload().then((RE: typeof ResEdit) =\u003e {\n  // RE will be the namespace object of resedit library\n  // (for example RE.Data.IconFile is available)\n});\n```\n\n\u003c/details\u003e\n\n## Supported formats\n\n- Windows Executables (PE Format, such as `.exe` and `.dll`), both 32-bit and 64-bit, are supported.\n  - Executables for 16-bit Windows is not supported.\n- `.res` file is not supported now.\n- PNG-based icon data is supported on `require('resedit').Resource.IconGroupEntry` class.\n\n## Parsing signed executables\n\n- Parsing signed executables (by using Authenticode or etc.) is not allowed by default and an exception will be thrown if `NtExecutable.from` receives a signed binary.\n- To parse signed, `{ ignoreCert: true }` object must be passed to the second argument of `NtExecutable.from`.\n- Although the base executable data is signed, `NtExecutable.generate` will generate unsigned executable binary. If you want to re-sign it, you must use generate-function with signing (see below) or any other signing tool such as Microsoft `signtool`.\n\n## Signing executables with resedit-js\n\nresedit-js provides basic signing process `generateExecutableWithSign` function, which is based on [Authenticode specification](https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/authenticode_pe.docx) and related RFCs.\n\nTo keep resedit-js generic library, the followings are required to use signing process.\n\n- Encryption / calculating hash (digest) process (e.g. Node.js built-in `crypto` module)\n  - A private key data is implicitly required to encrypt data.\n- DER-format certificate binary (such as `*.cer` file data or `*.p7b` file data with DER-format), which is paired with the private key used by encryption process.\n- (optional) Generating timestamp data, especially communicating with TSA server (e.g. HTTP/HTTPS API)\n\nThese requirements are represented as [`SignerObject`](./src/main/sign/SignerObject.ts). The caller of `generateExecutableWithSign` function must implement this object to sign executables.\n\nAn example code is here: [signTest.mjs](./examples/sign/signTest.mjs)\n\nNote that resedit-js only provides basic signing process, and provides as beta version. For example adding more attributes/informations to certificates are not supported now.\n\n\u003e Some digest algorithms, such as SHA3 algorithms, might not be supported by current Windows.\n\n## Notes\n\n- **It is not strongly recommended that the destination executable file is equal to the source executable file (which is not an intermediate data).**\n\n## Examples\n\n```js\nimport * as PELibrary from 'pe-library';\nimport * as ResEdit from 'resedit';\nimport * as fs from 'fs';\n\n// load and parse data\nconst data = fs.readFileSync('MyApp.exe');\n// (the Node.js Buffer instance can be specified directly to NtExecutable.from)\nconst exe = PELibrary.NtExecutable.from(data);\nconst res = PELibrary.NtExecutableResource.from(exe);\n\n// rewrite resources\n// - You can use helper classes as followings:\n//   - ResEdit.Resource.IconGroupEntry: access icon resource data\n//   - ResEdit.Resource.StringTable: access string resource data\n//   - ResEdit.Resource.VersionInfo: access version info data\n\n// -- replace icons\n\n// load icon data from file\n// (you can use ResEdit.Data.IconFile to parse icon data)\nconst iconFile = ResEdit.Data.IconFile.from(fs.readFileSync('MyIcon.ico'));\n\nResEdit.Resource.IconGroupEntry.replaceIconsForResource(\n  // destEntries\n  res.entries,\n  // iconGroupID\n  // - This ID is originally defined in base executable file\n  //   (the ID list can be retrieved by `ResEdit.Resource.IconGroupEntry.fromEntries(res.entries).map((entry) =\u003e entry.id)`)\n  101,\n  // lang ('lang: 1033' means 'en-US')\n  1033,\n  // icons (map IconFileItem to IconItem/RawIconItem)\n  iconFile.icons.map((item) =\u003e item.data)\n);\n\n// -- replace version\n\nconst viList = ResEdit.Resource.VersionInfo.fromEntries(res.entries);\nconst vi = viList[0];\n// setFileVersion will set `vi.fixedInfo.fileVersionMS`/`fileVersionLS` and 'FileVersion' string value\n// ('1033' means 'en-US')\nvi.setFileVersion(1, 0, 0, 0, 1033);\n// ('lang: 1033' means 'en-US', 'codepage: 1200' is the default codepage)\nvi.setStringValues(\n  { lang: 1033, codepage: 1200 },\n  {\n    FileDescription: 'My application',\n    ProductName: 'My product',\n  }\n);\nvi.outputToResourceEntries(res.entries);\n\n// write to another binary\nres.outputResource(exe);\nconst newBinary = exe.generate();\nfs.writeFileSync('MyApp_modified.exe', Buffer.from(newBinary));\n```\n\n## License\n\n[MIT License](./LICENSE)\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjet2jet%2Fresedit-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjet2jet%2Fresedit-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjet2jet%2Fresedit-js/lists"}