{"_id":"@bun-win32/clfsw32","_rev":"4-42e94f9b3b4f4ada6b449f342890cd8d","name":"@bun-win32/clfsw32","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/clfsw32","version":"1.0.0","keywords":["bun","ffi","win32","windows","clfsw32","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/clfsw32@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":"b3b06dd501d3757a703247caf98fb9275fc1d929","tarball":"https://registry.npmjs.org/@bun-win32/clfsw32/-/clfsw32-1.0.0.tgz","fileCount":6,"integrity":"sha512-8bypx5QnK7Z/GakYsgcLFeU1f+SauEr50icxs3VNFaQmlaPsFR6D8ShxlIQ/sraxBRczL9NQXd3j8LOJO2bUiw==","signatures":[{"sig":"MEYCIQCuDdBrqaiiOukvv2QxtgQpz1OfdEmACBh9MwljY9j5UwIhAJa7e/fzaFYFm9J4803N813Kl5bFtretsFBIMeY/W1Pg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36754},"main":"./index.ts","type":"module","module":"index.ts","shasum":"b3b06dd501d3757a703247caf98fb9275fc1d929","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:ledger":"bun ./example/transaction-ledger.ts","example:diagnostic":"bun ./example/clfs-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-8bypx5QnK7Z/GakYsgcLFeU1f+SauEr50icxs3VNFaQmlaPsFR6D8ShxlIQ/sraxBRczL9NQXd3j8LOJO2bUiw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/clfsw32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CLFSW32 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/clfsw32_1.0.0_1780539747534_0.03226806440239094","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/clfsw32","version":"1.0.1","keywords":["bun","ffi","win32","windows","clfsw32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/clfsw32@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":"67e92cbf0e5eb730491beaaeed0fc0fb9cdb0352","tarball":"https://registry.npmjs.org/@bun-win32/clfsw32/-/clfsw32-1.0.1.tgz","fileCount":6,"integrity":"sha512-pzpwNhx27iDpp/xBKsfhEVlClAK77YUdo8t52r02e3ri6ZvWUyi1NXziUl+d1ZU7N+QpGUzPvj2zWXHyVU9a0A==","signatures":[{"sig":"MEQCIBZwh6ORSG1hI+e0XCREQhUMExUFkWIckr5kL3keDnvFAiAPJrFIKO+w3iR5gCxFPt2in/joKj1bP4LudFsHcRjPHA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36759},"main":"./index.ts","type":"module","module":"index.ts","shasum":"67e92cbf0e5eb730491beaaeed0fc0fb9cdb0352","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:ledger":"bun ./example/transaction-ledger.ts","example:diagnostic":"bun ./example/clfs-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-pzpwNhx27iDpp/xBKsfhEVlClAK77YUdo8t52r02e3ri6ZvWUyi1NXziUl+d1ZU7N+QpGUzPvj2zWXHyVU9a0A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/clfsw32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CLFSW32 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"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/clfsw32_1.0.1_1781130796486_0.10227371314706324","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/clfsw32","version":"2.0.0","keywords":["bun","ffi","win32","windows","clfsw32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/clfsw32@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":"ef972163d3c8315f6279aa204cad2fe3ed6363fd","tarball":"https://registry.npmjs.org/@bun-win32/clfsw32/-/clfsw32-2.0.0.tgz","fileCount":6,"integrity":"sha512-zGT55C/8WshBMTjuWAqSxzcNfIBjnh0G2S1Y3v+siNsqfZAqoWC3oEHrSfL5nnrxU45LNEwVUQ0t6uQgot/o0Q==","signatures":[{"sig":"MEUCIBkTJXmbfxzMyo37AV8YXXYNftYcq/lgGzglXrWZrEo3AiEAl4wHywkz2ub9MXaoFWmBTYkLBtK9RQOMO5jUa0TkHc8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39185},"main":"./index.ts","type":"module","module":"index.ts","shasum":"ef972163d3c8315f6279aa204cad2fe3ed6363fd","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:ledger":"bun ./example/transaction-ledger.ts","example:diagnostic":"bun ./example/clfs-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-zGT55C/8WshBMTjuWAqSxzcNfIBjnh0G2S1Y3v+siNsqfZAqoWC3oEHrSfL5nnrxU45LNEwVUQ0t6uQgot/o0Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/clfsw32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CLFSW32 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/clfsw32_2.0.0_1782435277129_0.06594276003335087","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 CLFSW32 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/clfsw32","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/clfsw32"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","clfsw32","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:ledger":"bun ./example/transaction-ledger.ts","example:diagnostic":"bun ./example/clfs-diagnostic.ts"},"_id":"@bun-win32/clfsw32@2.0.1","_integrity":"sha512-D52VrkRz6lgDlqeIXGIJk7HTuJFyvTRu7K+FC7XNdfP5scNScj8a9DXC9eDzqHwO4uvT3gy41X3wY2eTHBz4Jw==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"382377ac38fdf2a67267bca153bf37286f12b01b","dist":{"integrity":"sha512-D52VrkRz6lgDlqeIXGIJk7HTuJFyvTRu7K+FC7XNdfP5scNScj8a9DXC9eDzqHwO4uvT3gy41X3wY2eTHBz4Jw==","shasum":"382377ac38fdf2a67267bca153bf37286f12b01b","tarball":"https://registry.npmjs.org/@bun-win32/clfsw32/-/clfsw32-2.0.1.tgz","fileCount":6,"unpackedSize":39185,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH3O/VF91ymYorQpOLZpc2s7LzxgMXMKdgYrJ7oJXi5WAiEAsz5OkjNHPeqQDAc1xPuhSnPgW/GcQbHyB2xjqtZ97os="}]},"_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/clfsw32_2.0.1_1782437733218_0.6166580167386533"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-04T02:22:27.413Z","modified":"2026-06-26T01:35:33.503Z","1.0.0":"2026-06-04T02:22:27.672Z","1.0.1":"2026-06-10T22:33:16.623Z","2.0.0":"2026-06-26T00:54:37.294Z","2.0.1":"2026-06-26T01:35:33.371Z"},"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","clfsw32","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/clfsw32"},"description":"Zero-dependency, zero-overhead Win32 CLFSW32 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/clfsw32\n\nZero-dependency, zero-overhead Win32 Clfsw32 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/clfsw32` exposes the `clfsw32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Clfsw32`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nIt binds all 53 documented Common Log File System user-mode APIs — the `clfsw32.h` log/container/marshaling/archive surface plus the `clfsmgmtw32.h` management surface — for high-performance transactional write-ahead logging, the same engine that backs TxF, TxR, and Kernel Transaction Manager.\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 `clfsw32.dll` (Common Log File System: log files, containers, marshaling areas, records, LSN algebra, archival, and CLFS management policy).\n- In-source docs in `structs/Clfsw32.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Clfsw32.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Clfsw32.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n> [!NOTE]\n> `CreateLogFile`, `ValidateLog`, and the LSN-algebra functions work from a standard token. Creating containers and appending records (`AddLogContainer`, `CreateLogMarshallingArea`, `ReserveAndAppendLog`, the CLFS management APIs) flow through `CLFS.sys` and require an **elevated** process; unelevated they return `ERROR_ACCESS_DENIED`.\n\n## Installation\n\n```sh\nbun add @bun-win32/clfsw32\n```\n\n## Quick Start\n\n```ts\nimport Clfsw32, { GENERIC_READ, GENERIC_WRITE, INVALID_HANDLE_VALUE, OPEN_ALWAYS } from '@bun-win32/clfsw32';\n\n// CLFS appends \".blf\"; the \"LOG:\" prefix selects the dedicated-log namespace.\nconst name = Buffer.from('LOG:C:\\\\Temp\\\\demo\\0', 'utf16le');\n\nconst hLog = Clfsw32.CreateLogFile(name.ptr, GENERIC_READ | GENERIC_WRITE, 0, null, OPEN_ALWAYS, 0);\nif (hLog !== INVALID_HANDLE_VALUE) {\n  // Validate the on-disk log metadata.\n  console.log('valid:', Clfsw32.ValidateLog(name.ptr, null, null, Buffer.alloc(4).ptr) !== 0);\n\n  // CLFS_LSN is an 8-byte value returned by value; compose then decompose one.\n  const lsn = Clfsw32.LsnCreate(5, 0x2000, 7); // -> bigint\n  const buf = Buffer.alloc(8);\n  buf.writeBigUInt64LE(lsn, 0);\n  console.log(Clfsw32.LsnContainer(buf.ptr), Clfsw32.LsnBlockOffset(buf.ptr), Clfsw32.LsnRecordSequence(buf.ptr));\n\n  Clfsw32.DeleteLogFile(name.ptr, null);\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:\n\n```sh\nbun run example:diagnostic   # thorough CLFS subsystem diagnostic + LSN ABI proof\nbun run example:ledger       # animated write-ahead-log / LSN cartographer\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Clfsw32.Preload()`.\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"}