{"_id":"@bun-win32/dismapi","_rev":"4-da1f471657b24f486f13e38a1a172bfd","name":"@bun-win32/dismapi","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/dismapi","version":"1.0.0","keywords":["bun","ffi","win32","windows","dismapi","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/dismapi@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"4a8fccb27e352ad7188b966c2a02592de51285d7","tarball":"https://registry.npmjs.org/@bun-win32/dismapi/-/dismapi-1.0.0.tgz","fileCount":6,"integrity":"sha512-VrGsCsGm4mYjiKflEj0/lyER4SjtspiPqyh+LXYbJo4SwyCjCOTiFBoq9D8M50zyxp9FRThx1JDNF2kn/DnA/Q==","signatures":[{"sig":"MEUCIEEE6BMxWR2e/YKD+C6OwPuap+jsrggCTgiMbx1B0NiSAiEAkfWDTeO8tFp/6hfoQcn7W1pWgZyPmrEGdDR3mLmATWY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28748},"main":"./index.ts","type":"module","module":"index.ts","shasum":"4a8fccb27e352ad7188b966c2a02592de51285d7","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-health-report":"bun ./example/image-health-report.ts","example:servicing-inventory":"bun ./example/servicing-inventory.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-VrGsCsGm4mYjiKflEj0/lyER4SjtspiPqyh+LXYbJo4SwyCjCOTiFBoq9D8M50zyxp9FRThx1JDNF2kn/DnA/Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/dismapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 DISM API bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"1.0.21"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/dismapi_1.0.0_1779150539822_0.5433244290432433","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/dismapi","version":"1.0.1","keywords":["bun","ffi","win32","windows","dismapi","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/dismapi@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"e00e3f39f9ec2f2aebc17e53152a5c20507c83e8","tarball":"https://registry.npmjs.org/@bun-win32/dismapi/-/dismapi-1.0.1.tgz","fileCount":6,"integrity":"sha512-59q6ik0VLyxO+af4guOlQ2RmBao8/5lJf0HQQo1MX4lJ0wC1y/7G7iz6LB3sQ18Qz47wLL97x1h2wXED5a4B3g==","signatures":[{"sig":"MEQCIA4PSrPNPAWSo/TTD/nV2BJIhYJEuGTzjDpcht1FSGkZAiBseXy0gkvGZgHLN3mz7kOgL8xOzWZkvQUJaBNCXjrZ0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28753},"main":"./index.ts","type":"module","module":"index.ts","shasum":"e00e3f39f9ec2f2aebc17e53152a5c20507c83e8","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-health-report":"bun ./example/image-health-report.ts","example:servicing-inventory":"bun ./example/servicing-inventory.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-59q6ik0VLyxO+af4guOlQ2RmBao8/5lJf0HQQo1MX4lJ0wC1y/7G7iz6LB3sQ18Qz47wLL97x1h2wXED5a4B3g==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/dismapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 DISM API bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"1.0.26"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/dismapi_1.0.1_1781130819154_0.7492096562073525","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/dismapi","version":"2.0.0","keywords":["bun","ffi","win32","windows","dismapi","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/dismapi@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"d52d734da002d1b436d907d90baec95b1181f47c","tarball":"https://registry.npmjs.org/@bun-win32/dismapi/-/dismapi-2.0.0.tgz","fileCount":6,"integrity":"sha512-rog3rmwzepY2bMZLW1qT5p8dODIQqWo8zm1M0VkPb/tGWoKtsoDLpYiCzHX0S3Cidtw5CGDvQpTzKVcml2Mc/A==","signatures":[{"sig":"MEUCIHPuaP+WFhJSYEbbv/dUZub1aR/VoautpTILPvAOJu+6AiEAoD/EZI48ooA8MLhoRZziAgRcbjPNpqDlLVVvGqSMwVo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30471},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d52d734da002d1b436d907d90baec95b1181f47c","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:image-health-report":"bun ./example/image-health-report.ts","example:servicing-inventory":"bun ./example/servicing-inventory.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-rog3rmwzepY2bMZLW1qT5p8dODIQqWo8zm1M0VkPb/tGWoKtsoDLpYiCzHX0S3Cidtw5CGDvQpTzKVcml2Mc/A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/dismapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 DISM API bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/dismapi_2.0.0_1782435297457_0.7757575489287878","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 DISM API bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/dismapi","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/dismapi"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","dismapi","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:servicing-inventory":"bun ./example/servicing-inventory.ts","example:image-health-report":"bun ./example/image-health-report.ts"},"_id":"@bun-win32/dismapi@2.0.1","_integrity":"sha512-Di/dSttrCVkjlIRo1gFBd/4RzHTxnItfoPxp8rYUW1L7LzONrg4090HUgfSgaQWpJwLVf3eGuSqlgjpjy4K5fA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"2dfba5ff1993e59f8b087c2809080b8bb64cdbc1","dist":{"integrity":"sha512-Di/dSttrCVkjlIRo1gFBd/4RzHTxnItfoPxp8rYUW1L7LzONrg4090HUgfSgaQWpJwLVf3eGuSqlgjpjy4K5fA==","shasum":"2dfba5ff1993e59f8b087c2809080b8bb64cdbc1","tarball":"https://registry.npmjs.org/@bun-win32/dismapi/-/dismapi-2.0.1.tgz","fileCount":6,"unpackedSize":30471,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCle44XweumlD2rSSOHvaVWvjWaW/iWQxkOOaa8x9cJ/gIgAxOepcYj6S2ryuHnPkyAmS/PuGWocFf0oqGSRQfaYYU="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dismapi_2.0.1_1782437757971_0.6540256107615725"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T00:28:59.738Z","modified":"2026-06-26T01:35:58.247Z","1.0.0":"2026-05-19T00:28:59.985Z","1.0.1":"2026-06-10T22:33:39.290Z","2.0.0":"2026-06-26T00:54:57.569Z","2.0.1":"2026-06-26T01:35:58.118Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","dismapi","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/dismapi"},"description":"Zero-dependency, zero-overhead Win32 DISM API bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/dismapi\n\nZero-dependency, zero-overhead Win32 DISM API bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/dismapi` exposes the `dismapi.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Dismapi`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe Deployment Image Servicing and Management (DISM) API is the supported, in-process way to install/uninstall/configure/update Windows features, packages, drivers, and capabilities in an online or offline Windows image (`.wim`/`.vhd`/`.vhdx`) — the same engine `DISM.exe` drives, with no process spawn.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `dismapi.dll` (image servicing: sessions, features, packages, drivers, capabilities, health, mount).\n- In-source docs in `structs/Dismapi.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Dismapi.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Dismapi.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n- An **elevated** process (the DISM API returns `ERROR_ELEVATION_REQUIRED` otherwise)\n\n## Installation\n\n```sh\nbun add @bun-win32/dismapi\n```\n\n## Quick Start\n\n```ts\nimport Dismapi, { DISM_ONLINE_IMAGE, DismLogLevel, DismPackageIdentifier } from '@bun-win32/dismapi';\n\nif (Dismapi.DismInitialize(DismLogLevel.DismLogErrorsWarnings, null, null) === 0) {\n  const sess = Buffer.alloc(4); // DismSession is a UINT\n  const online = Buffer.from(DISM_ONLINE_IMAGE + '\\0', 'utf16le');\n  if (Dismapi.DismOpenSession(online.ptr, null, null, sess.ptr) === 0) {\n    const session = sess.readUInt32LE(0);\n\n    const arr = Buffer.alloc(8); // receives a DISM-allocated array pointer\n    const count = Buffer.alloc(4);\n    Dismapi.DismGetFeatures(session, null, DismPackageIdentifier.DismPackageNone, arr.ptr, count.ptr);\n    console.log('optional features:', count.readUInt32LE(0));\n\n    Dismapi.DismCloseSession(session);\n  }\n  Dismapi.DismShutdown(); // always pair with DismInitialize\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples (run elevated for full output):\n\n```sh\nbun run example/servicing-inventory.ts\nbun run example/image-health-report.ts\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Dismapi.Preload()`.\n- `DismSession` is a `UINT` (`number`), not a handle — read it from a 4-byte buffer after `DismOpenSession`.\n- `DismGet*` functions return a **DISM-allocated** array via a `T**` out-pointer plus a `UINT` count; you read the count from your own buffer, then walk the returned pointer and **must** free it with `DismDelete`.\n- Long-running functions accept an optional `CancelEvent` (event `HANDLE`, `0n` for none), `Progress` (`DISM_PROGRESS_CALLBACK`, `null` for none), and `UserData` (`null` for none).\n- Always pair `DismInitialize`/`DismShutdown` and `DismOpenSession`/`DismCloseSession`.\n- Six `dismapi.dll` exports (`DismAddLanguage`, `DismAddProvisionedAppxPackage`, `DismGetPackageInfoEx`, `DismGetProvisionedAppxPackages`, `DismRemoveLanguage`, `DismRemoveProvisionedAppxPackage`) are undocumented and intentionally not bound.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}