You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ffd235a
Browse filesBrowse the repository at this point in the historyBrowse files
Add a programmatic library API (buffer cores + decodeFile)
Exposes the decode/encode functionality as an importable API alongside
the CLIs, with ESM + CJS builds and TypeScript declarations.
API (src/index.ts):
- decodeBuffer(bytes) -> { format, xml } and encodeBuffer(xml, format,
{ blockSize? }) -> Buffer: pure buffer-in/buffer-out cores for the
compressed-xml containers, factored out of the file/CLI wrappers.
- decodeMdbBuffer(bytes) -> MdbJson: Jet database -> plain JS object.
- decodeFile(path) -> DecodeResult: reads a file and returns decoded
values in memory, discriminated by kind (compressed-xml -> xml bytes,
mdb -> data object). This is the "filename -> decoded JS objects" path.
- the format registry (FORMATS, formatByKey, detectFormatByHeader, …)
and all supporting types.
Build / packaging:
- build.ts now also emits dist/index.mjs + dist/index.cjs (deps inlined);
tsconfig.build.json emits self-contained dist/*.d.ts via tsc.
- package.json gains main/module/types/exports; bin unchanged.
- Decode/encode functions now take a minimal local `Logger` interface
(src/util/logger.ts) instead of winston's type, so winston stays out
of the published type declarations (consumers don't install it — it's
bundled). winston loggers remain structurally compatible.
Verified: installed the packed tarball into a clean project and
round-tripped through both `require` (CJS) and `import` (ESM). 81 tests
pass (+9 API tests); types are self-contained (no external imports).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments