@fkn/fs-polyfill
v0.4.2
Published
Node fs / fs/promises polyfill backed by FKN storage (OPFS + cloud)
Readme
@fkn/fs-polyfill
A Node fs / fs/promises polyfill backed by FKN storage. A thin re-export of @fkn/lib's nodeFs; all the
logic lives there (an in-memory layer for synchronous reads/writes, persisted to OPFS locally and replicated to
the cloud across devices).
Alias fs and fs/promises to this package in your bundler:
// vite.config.ts
resolve: {
alias: {
fs: '@fkn/fs-polyfill',
'fs/promises': '@fkn/fs-polyfill/promises',
},
}fs.mount() hydrates the working set from storage (await it before synchronous reads); fs.flush() forces a
write-back. v1 implements the common whole-file ops; the fd/open, stream, and watch APIs are not yet covered.
