{"name":"@jsonjoy.com/fs-node-to-fsa","version":"4.74.0","keywords":["fs","filesystem","fsa","file-system-access","node-to-fsa","adapter"],"author":{"url":"https://github.com/streamich","name":"streamich"},"license":"Apache-2.0","_id":"@jsonjoy.com/fs-node-to-fsa@4.74.0","maintainers":[{"name":"json-joy-team","email":"team@jsonjoy.com"},{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"homepage":"https://github.com/streamich/memfs/tree/master/packages/fs-node-to-fsa","bugs":{"url":"https://github.com/streamich/memfs/issues"},"dist":{"shasum":"f6a4e2cacc009b91b5380259d4bfc5c05bec5161","tarball":"http://registry-npm.ywwl.com/@jsonjoy.com/fs-node-to-fsa/download/@jsonjoy.com/fs-node-to-fsa-4.74.0.tgz","fileCount":33,"integrity":"sha512-4MnTEOVQRmept4HIZUTgHwLy+dvcVz7DHmTz/aUa3jwI8detOhAX4F2rAOVhDPu2lEL/DGOpAGLPjKHsOhBtQw==","signatures":[{"sig":"MEYCIQDtTua16ZINAkHvP3Zxjw1Usw+Bi3dwsTEgiyrZ014ragIhAKdP8C4VYfIGwwCsF9vmQzQkzevuzDxjPzuxguhqEUqk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDibZHT5Tr30rksbBD7ALXwqD15eTwbdRbq6Su94H5kyQIhALOiVdjZNgCRo0CQ1GsOvZCI1CgfsZfb5GyomB/97X7+","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@jsonjoy.com%2ffs-node-to-fsa@4.74.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":122335,"size":23358,"noattachment":false,"key":"/@jsonjoy.com/fs-node-to-fsa/-/@jsonjoy.com/fs-node-to-fsa-4.74.0.tgz"},"jest":{"preset":"ts-jest","rootDir":".","testRegex":".*/(__tests__|__jest__|demo)/.*\\.(test|spec)\\.tsx?$","transform":{"^.+\\.tsx?$":"ts-jest"},"testEnvironment":"node","moduleFileExtensions":["ts","js","tsx"],"testPathIgnorePatterns":["node_modules"],"transformIgnorePatterns":[".*/node_modules/.*"]},"main":"lib/index.js","_from":"file:package.tgz","types":"lib/index.d.ts","engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"scripts":{"jest":"node -r ts-node/register ./node_modules/.bin/jest","test":"jest --maxWorkers 7","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","clean":"rimraf lib typedocs coverage gh-pages yarn-error.log","test:ci":"yarn jest --maxWorkers 3 --no-cache","typedoc":"typedoc","coverage":"yarn test --collectCoverage","typecheck":"tsc -p ."},"typings":"lib/index.d.ts","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0f95ece2-95ae-401c-bb20-e8975d19b288"}},"_resolved":"/home/runner/work/memfs/memfs/packages/fs-node-to-fsa/package.tgz","_integrity":"sha512-4MnTEOVQRmept4HIZUTgHwLy+dvcVz7DHmTz/aUa3jwI8detOhAX4F2rAOVhDPu2lEL/DGOpAGLPjKHsOhBtQw==","repository":{"url":"git+https://github.com/streamich/memfs.git","type":"git"},"_npmVersion":"11.19.0","description":"Adapter to convert Node.js fs API to File System Access API","directories":{},"_nodeVersion":"24.20.0","dependencies":{"@jsonjoy.com/fs-fsa":"4.74.0","@jsonjoy.com/fs-node-utils":"4.74.0","@jsonjoy.com/fs-node-builtins":"4.74.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","memfs":"4.74.0","rimraf":"^5.0.0","ts-jest":"^29.4.2","ts-node":"^10.9.2","typescript":"^5.9.2","@types/jest":"^29.0.0","@types/node":"^20.0.0","@jsonjoy.com/fs-node":"4.74.0"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"tmp":"tmp/fs-node-to-fsa_4.74.0_1789064345068_0.9294135391355287","host":"s3://npm-registry-packages-npm-production"},"readme":"# @jsonjoy.com/fs-node-to-fsa\n\nAdapter to convert [Node.js fs API][node-fs] to [File System Access API][fsa] (FSA).\n\n## Installation\n\n```bash\nnpm install @jsonjoy.com/fs-node-to-fsa\n```\n\n## Usage\n\n```ts\nimport { nodeToFsa } from '@jsonjoy.com/fs-node-to-fsa';\nimport * as fs from 'fs';\n\nconst dir = nodeToFsa(fs, '/path/to/directory', { mode: 'readwrite' });\n\n// Now use the FSA API\nfor await (const [name, handle] of dir.entries()) {\n  console.log(name, handle.kind);\n}\n```\n\n## FileSystemObserver\n\n`NodeFileSystemObserver` implements the [`FileSystemObserver` proposal][observer]\non top of the Node.js `fs.watch` API. It is a best-effort implementation, per\nthe proposal's allowance for local file systems: `rename` events are classified\ninto `\"appeared\"`/`\"disappeared\"` records by stat-ing the path, and no\n`\"moved\"` records are ever produced.\n\n```ts\nimport { nodeToFsa, NodeFileSystemObserver } from '@jsonjoy.com/fs-node-to-fsa';\nimport * as fs from 'fs';\n\nconst dir = nodeToFsa(fs, '/path/to/directory', { mode: 'readwrite' });\nconst observer = new NodeFileSystemObserver(fs, records => console.log(records));\nawait observer.observe(dir, { recursive: true });\n```\n\n## Reference\n\n- [`nodeToFsa(fs, path, ctx)`](src/index.ts) - Converts a Node.js `fs` module to a `FileSystemDirectoryHandle`.\n- [`NodeFileSystemObserver`](src/NodeFileSystemObserver.ts) - A `FileSystemObserver` implementation backed by `fs.watch`.\n\n[node-fs]: https://nodejs.org/api/fs.html\n[fsa]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API\n[observer]: https://developer.mozilla.org/en-US/docs/Web/API/FileSystemObserver\n","publish_time":1789064345150,"_cnpm_publish_time":1789064345150,"dist-tags":{"latest":"4.80.1"}}