{"name":"pe-library","version":"2.0.1","engines":{"node":">=20"},"description":"Node.js library for Portable Executable format","module":"./dist/index.js","type":"module","exports":{".":"./dist/index.js","./cjs":{"require":"./cjs.cjs"}},"types":"./dist/index.d.ts","author":{"name":"jet"},"license":"MIT","homepage":"https://github.com/jet2jet/pe-library-js","keywords":["javascript","library","pe","pe-executable","portable-executable","exe"],"repository":{"type":"git","url":"git+https://github.com/jet2jet/pe-library-js.git"},"funding":{"type":"github","url":"https://github.com/sponsors/jet2jet"},"scripts":{"build":"npm run build:esm","build:esm":"tsc -p ./tsconfig.app.json","lint":"npm run lint:eslint && npm run lint:prettier","lint:eslint":"eslint -c eslint.config.mjs --ext .js,.jsx,.ts,.tsx .","lint:eslint:fix":"eslint -c eslint.config.mjs --fix --ext .js,.jsx,.ts,.tsx .","lint:fix":"npm run lint:eslint:fix && npm run lint:prettier:fix","lint:prettier":"prettier --config ./.prettierrc.yml --check \"**/*.{js,jsx,ts,tsx,yml,json,md}\"","lint:prettier:fix":"prettier --config ./.prettierrc.yml --write \"**/*.{js,jsx,ts,tsx,yml,json,md}\"","test":"jest --config ./jest.config.basic.js","typecheck":"tsc -p tsconfig.json && echo \"Done.\"","version":"node ./tools/updateVersion.js ./src/main/version.ts && git add -A ./src/main/version.ts"},"devDependencies":{"@types/jest":"^30.0.0","@types/node":"~20.19.22","@typescript-eslint/eslint-plugin":"^8.46.1","@typescript-eslint/parser":"^8.46.1","eslint":"^9.37.0","eslint-config-prettier":"^10.1.8","eslint-plugin-import-x":"^4.16.1","eslint-plugin-n":"^17.23.1","eslint-plugin-promise":"^7.2.1","jest":"^30.2.0","neostandard":"^0.12.2","prettier":"^3.6.2","ts-jest":"^29.4.5","typescript":"~4.9.5"},"_id":"pe-library@2.0.1","gitHead":"33076cac9b7e79e4cd26d946700642c5d241d8e6","bugs":{"url":"https://github.com/jet2jet/pe-library-js/issues"},"_nodeVersion":"20.19.5","_npmVersion":"11.5.1","dist":{"integrity":"sha512-/qjYFqNSlq59B5DI36am++5/3gMgh02QnzpYigrwrW6s+QpU0mHf09/iA4wjTu21UUxodyV7ZCetV5MiDhaN/A==","shasum":"00e6732546d616279944de39685b91a05aa24f8a","tarball":"http://registry-npm.ywwl.com/pe-library/download/pe-library-2.0.1.tgz","fileCount":45,"unpackedSize":141490,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/pe-library@2.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHuffevxnOS2BxhwEnFXxzMcpe9hGbuTQjcCpfY/sH5NAiEA0ckOftmX0yYIQDvyrOHHEmlmGdGB3Sq+0Gn+DmGOMaI="}],"size":25546,"noattachment":false,"key":"/pe-library/-/pe-library-2.0.1.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c4718224-861f-4ef6-a0f9-67e6025dd61e"}},"directories":{},"maintainers":[{"name":"jet2jet","email":"smalljet@hotmail.co.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pe-library_2.0.1_1762131459741_0.7889650309029868"},"_hasShrinkwrap":false,"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> Starting from v1.0.0, CommonJS support is changed; you must use `pe-library/cjs` to use from CommonJS file.\n\n```js\nconst { load } = require('pe-library/cjs');\nconst fs = require('fs');\nload().then((PE) => {\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) => {\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","publish_time":1762131459924,"_cnpm_publish_time":1762131459924,"dist-tags":{"latest":"2.0.1"}}