{"id":40951567,"url":"https://github.com/jet2jet/pe-library-js","last_synced_at":"2026-01-22T05:13:31.973Z","repository":{"id":57321600,"uuid":"436954826","full_name":"jet2jet/pe-library-js","owner":"jet2jet","description":"Provides parsing and generating Portable Executable binaries","archived":false,"fork":false,"pushed_at":"2025-12-22T10:46:10.000Z","size":385,"stargazers_count":26,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-23T21:50:45.720Z","etag":null,"topics":["javascript","javascript-library","nodejs","pe","pe-format","portable-executable"],"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":"2021-12-10T11:28:34.000Z","updated_at":"2025-12-22T10:41:34.000Z","dependencies_parsed_at":"2024-01-20T08:29:57.060Z","dependency_job_id":"893de77c-aad7-436c-a582-e711466a330d","html_url":"https://github.com/jet2jet/pe-library-js","commit_stats":{"total_commits":40,"total_committers":2,"mean_commits":20.0,"dds":"0.025000000000000022","last_synced_commit":"6448241f0db34d349ca3031160e0111c07160430"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/jet2jet/pe-library-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fpe-library-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fpe-library-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fpe-library-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fpe-library-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jet2jet","download_url":"https://codeload.github.com/jet2jet/pe-library-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jet2jet%2Fpe-library-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28655387,"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":["javascript","javascript-library","nodejs","pe","pe-format","portable-executable"],"created_at":"2026-01-22T05:13:31.122Z","updated_at":"2026-01-22T05:13:31.947Z","avatar_url":"https://github.com/jet2jet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://badge.fury.io/js/pe-library.svg)](https://www.npmjs.com/package/pe-library)\n[![Build Status](https://github.com/jet2jet/pe-library-js/actions/workflows/main-ci.yml/badge.svg)](https://github.com/jet2jet/pe-library-js)\n\n# pe-library\n\npe-library provides parsing and generating Portable Executable (known as Windows Executables) binaries.\n\n## Usage\n\n```js\nimport * as PE from 'pe-library';\nimport * as fs from 'fs';\n\n// load and parse data\nlet data = fs.readFileSync('MyApp.exe');\n// (the Node.js Buffer instance can be specified directly to NtExecutable.from)\nlet exe = PE.NtExecutable.from(data);\n\n// get section data\nlet exportSection = exe.getSectionByEntry(PE.Format.ImageDirectoryEntry.Export);\n// read binary data stored in exportSection.data ...\n// to write binary: use exe.setSectionByEntry\n\n// write to buffer\nlet newBin = exe.generate();\nfs.writeFileSync('MyApp_modified.exe', new Buffer(newBin));\n```\n\n### from CommonJS (using `require`)\n\n\u003e Starting from v1.0.0, CommonJS support is changed; you must use Node.js v20.19.0 or later, or use `pe-library/cjs` to use from CommonJS file.\n\nFor CommonJS with Node.js v20.19.0 or later:\n\n```js\nconst PE = require('pe-library');\n...\n```\n\nFor CommonJS with using `pe-library/cjs`:\n\n```js\nconst { load } = require('pe-library/cjs');\nconst fs = require('fs');\nload().then((PE) =\u003e {\n  // load and parse data\n  let data = fs.readFileSync('MyApp.exe');\n  // (the Node.js Buffer instance can be specified directly to NtExecutable.from)\n  let exe = PE.NtExecutable.from(data);\n\n  // get section data\n  let exportSection = exe.getSectionByEntry(\n    PE.Format.ImageDirectoryEntry.Export\n  );\n  // read binary data stored in exportSection.data ...\n  // to write binary: use exe.setSectionByEntry\n\n  // write to buffer\n  let newBin = exe.generate();\n  fs.writeFileSync('MyApp_modified.exe', new Buffer(newBin));\n});\n```\n\n#### for CommonJS-based TypeScript module\n\n```ts\n// you can use PE namespace for type-reference only\nimport { type PE, load } from 'pe-library/cjs';\nload().then((pe: typeof PE) =\u003e {\n  ...\n});\n```\n\n## License\n\n- All programs / source codes / binaries in this package, EXCEPT FOLLOWINGS, are licensed with [MIT License](./LICENSE).\n- The followings are licensed with 0-BSD license:\n  - [tools/dos-stub/dos-stub.asm](./tools/dos-stub/dos-stub.asm)\n  - The bit code, generated from tools/dos-stub/dos-stub.asm, written in [src/main/util/generate.ts](./src/main/util/generate.ts) as `DOS_STUB_PROGRAM`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjet2jet%2Fpe-library-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjet2jet%2Fpe-library-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjet2jet%2Fpe-library-js/lists"}