{"_id":"@bun-win32/winspool","_rev":"5-c254543465e6d3b984ec56de39d7c490","name":"@bun-win32/winspool","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/winspool","version":"1.0.0","keywords":["bun","ffi","win32","windows","winspool","printer","print-spooler","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/winspool@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":"9d3339bfa33a1ce52c96aeb1e9e63e6a4965e36d","tarball":"https://registry.npmjs.org/@bun-win32/winspool/-/winspool-1.0.0.tgz","fileCount":6,"integrity":"sha512-jkExLICHve5RkiAgs2/S52m3SjyNiARWfw7DpoHkHNz/NlOLlj5V0Yr/wCkOOx9M9a7jo8QBd/ULhT7nqAxMgQ==","signatures":[{"sig":"MEUCIQDFoUiVAQYYgbMca4+NpSmecCw/mXPiQpNaYgZ9WVvZEwIgP/VXqASvrrLooqaPV9HplFSgWNdapZ4qJDo5v8acbXw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81108},"main":"./index.ts","type":"module","module":"index.ts","shasum":"9d3339bfa33a1ce52c96aeb1e9e63e6a4965e36d","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example":"bun ./example/winspool.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-jkExLICHve5RkiAgs2/S52m3SjyNiARWfw7DpoHkHNz/NlOLlj5V0Yr/wCkOOx9M9a7jo8QBd/ULhT7nqAxMgQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/winspool"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WINSPOOL bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/winspool_1.0.0_1775598411635_0.8258614011932446","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/winspool","version":"1.0.1","keywords":["bun","ffi","win32","windows","winspool","printer","print-spooler","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/winspool@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":"064eecddee8962e1f6cc8428c1eed1ffd7652a66","tarball":"https://registry.npmjs.org/@bun-win32/winspool/-/winspool-1.0.1.tgz","fileCount":6,"integrity":"sha512-bgXzhgtUllP1vGCL9odNZfgRotisU7Hv88pE1+NNheLd29XeQg8OwS7dVpLTlsJzSrbqpY5GoJc8rucLSRjbsg==","signatures":[{"sig":"MEQCIAfcCMggWbxSDsx31X3u5UMVLy+9NNXGZoVKSLXnILdYAiBfkLhNTnd33RZirfm166yzjJKQpWUveTeZqeHe6aMa2g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82765},"main":"./index.ts","type":"module","module":"index.ts","shasum":"064eecddee8962e1f6cc8428c1eed1ffd7652a66","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:printer-audit":"bun ./example/printer-audit.ts","example:printer-showdown":"bun ./example/printer-showdown.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-bgXzhgtUllP1vGCL9odNZfgRotisU7Hv88pE1+NNheLd29XeQg8OwS7dVpLTlsJzSrbqpY5GoJc8rucLSRjbsg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/winspool"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WINSPOOL bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.1"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/winspool_1.0.1_1775687646001_0.36077383228432924","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bun-win32/winspool","version":"1.0.2","keywords":["bun","ffi","win32","windows","winspool","printer","print-spooler","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/winspool@1.0.2","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":"dc136e6c8284f4ba2bc3fe3d478f49e2e6dd93e1","tarball":"https://registry.npmjs.org/@bun-win32/winspool/-/winspool-1.0.2.tgz","fileCount":6,"integrity":"sha512-3ncMKm9VoE8QLQ5cRo5JTPreRScNJPEAxXWLq0OOTrZ/EZVnCoxqmNrXlqKNgNzY3eIFvbuba2g6/GDjpMVthw==","signatures":[{"sig":"MEUCIFeYNwSFjiBz4/rwHwZcegESYGgUZoLK+UUJfY2UHQshAiEAvHh19Rcr8TtAZy27Vd58KC1rX1HkAz2lKbjmb+bPsHw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82842},"main":"./index.ts","type":"module","module":"index.ts","shasum":"dc136e6c8284f4ba2bc3fe3d478f49e2e6dd93e1","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:printer-audit":"bun ./example/printer-audit.ts","example:printer-showdown":"bun ./example/printer-showdown.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-3ncMKm9VoE8QLQ5cRo5JTPreRScNJPEAxXWLq0OOTrZ/EZVnCoxqmNrXlqKNgNzY3eIFvbuba2g6/GDjpMVthw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/winspool"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WINSPOOL 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"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/winspool_1.0.2_1780581931643_0.7407479271560218","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/winspool","version":"2.0.0","keywords":["bun","ffi","win32","windows","winspool","printer","print-spooler","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/winspool@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":"46a7b41fd5bc65d45e32683dda8b59862ae8e059","tarball":"https://registry.npmjs.org/@bun-win32/winspool/-/winspool-2.0.0.tgz","fileCount":6,"integrity":"sha512-rFs3ZBg/QM5v/mJf+VhxAGzZdNMPM9SSCfsJZMY/rMlN9G8+94o29HHIePa38bavWCv64s2Q0etZYDurqAxTQw==","signatures":[{"sig":"MEUCIQDhL5hanlPAWjUPoPeG95ApU0KvLj/7rT1KSBVXHwcCQwIgM9dqY9jgHHeaA/lAeKcmnUaxFA0URHpci1si2UwlXDg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84900},"main":"./index.ts","type":"module","module":"index.ts","shasum":"46a7b41fd5bc65d45e32683dda8b59862ae8e059","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:printer-audit":"bun ./example/printer-audit.ts","example:printer-showdown":"bun ./example/printer-showdown.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-rFs3ZBg/QM5v/mJf+VhxAGzZdNMPM9SSCfsJZMY/rMlN9G8+94o29HHIePa38bavWCv64s2Q0etZYDurqAxTQw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/winspool"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WINSPOOL 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"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/winspool_2.0.0_1782435997860_0.8660610885142557","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 WINSPOOL bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/winspool","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/winspool"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","winspool","printer","print-spooler","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:printer-showdown":"bun ./example/printer-showdown.ts","example:printer-audit":"bun ./example/printer-audit.ts"},"_id":"@bun-win32/winspool@2.0.1","_integrity":"sha512-zgfUO7BzIN13qiu1yyShpsZ071tzXfr0moxyxT53eh+kvujHWA11yBtZGMk6Ie0zJwiOt3Y0o0jieDXQxBOb2w==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"05577320be71cdeb4207646dd0b79a95c67f69c8","dist":{"integrity":"sha512-zgfUO7BzIN13qiu1yyShpsZ071tzXfr0moxyxT53eh+kvujHWA11yBtZGMk6Ie0zJwiOt3Y0o0jieDXQxBOb2w==","shasum":"05577320be71cdeb4207646dd0b79a95c67f69c8","tarball":"https://registry.npmjs.org/@bun-win32/winspool/-/winspool-2.0.1.tgz","fileCount":6,"unpackedSize":84900,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDEY6S/LdAL9//DU2no0o02ITVgY1Xjk92O676ExFxOPAIhAM2cGb0gDfAFPPBxnCBXQbsfxkNH/fCQBdD4+PKaX+Ww"}]},"_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/winspool_2.0.1_1782438223029_0.6233072465294234"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-07T21:46:51.529Z","modified":"2026-06-26T01:43:43.287Z","1.0.0":"2026-04-07T21:46:51.782Z","1.0.1":"2026-04-08T22:34:06.146Z","1.0.2":"2026-06-04T14:05:31.839Z","2.0.0":"2026-06-26T01:06:38.029Z","2.0.1":"2026-06-26T01:43:43.175Z"},"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","winspool","printer","print-spooler","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/winspool"},"description":"Zero-dependency, zero-overhead Win32 WINSPOOL bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/winspool\r\n\r\nZero-dependency, zero-overhead Win32 Winspool bindings for [Bun](https://bun.sh) on Windows.\r\n\r\n## Overview\r\n\r\n`@bun-win32/winspool` exposes the `winspool.drv` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Winspool`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\r\n\r\nThe bindings are strongly typed for a smooth DX in TypeScript.\r\n\r\n## Features\r\n\r\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\r\n- Direct FFI to `winspool.drv` (printer management, print jobs, spooler control, driver management, and more).\r\n- In-source docs in `structs/Winspool.ts` with links to Microsoft Docs.\r\n- Lazy binding on first call; optional eager preload (`Winspool.Preload()`).\r\n- No wrapper overhead; calls map 1:1 to native APIs.\r\n- Strongly-typed Win32 aliases (see `types/Winspool.ts`).\r\n\r\n## Requirements\r\n\r\n- [Bun](https://bun.sh) runtime\r\n- Windows 10 or later\r\n\r\n## Installation\r\n\r\n```sh\r\nbun add @bun-win32/winspool\r\n```\r\n\r\n## Quick Start\r\n\r\n```ts\r\nimport Winspool from '@bun-win32/winspool';\r\n\r\n// Get the default printer name (sizing call, then read)\r\nconst sizeBuffer = Buffer.alloc(4);\r\nWinspool.GetDefaultPrinterW(null, sizeBuffer.ptr);\r\n\r\nconst charsNeeded = sizeBuffer.readUInt32LE(0);\r\nconst nameBuffer = Buffer.alloc(charsNeeded * 2);\r\nsizeBuffer.writeUInt32LE(charsNeeded, 0);\r\n\r\nWinspool.GetDefaultPrinterW(nameBuffer.ptr, sizeBuffer.ptr);\r\nconst printerName = new TextDecoder('utf-16').decode(nameBuffer).replace(/\\0.*$/, '');\r\nconsole.log('Default printer:', printerName);\r\n```\r\n\r\n> [!NOTE]\r\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.\r\n\r\n## Examples\r\n\r\nRun the included examples:\r\n\r\n```sh\r\nbun run example              # Default printer + printer enumeration\r\n```\r\n\r\n## Notes\r\n\r\n- Either rely on lazy binding or call `Winspool.Preload()`.\r\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"}