{"_id":"@jsonjoy.com/fs-node-to-fsa@4.68.2","bugs":{"url":"https://github.com/streamich/memfs/issues"},"dist":{"shasum":"faf01a277752868d90681f6dcb86d3e01f05a296","tarball":"http://registry-npm.ywwl.com/@jsonjoy.com/fs-node-to-fsa/download/@jsonjoy.com/fs-node-to-fsa-4.68.2.tgz","fileCount":33,"integrity":"sha512-4O1K4w5G4oJIpKpoa3WSLG83AsQYVnGv+aUSBGOvIUph9Axm6bB1mPlvldkNg2tBx/4dkiTlZnqNrK5SQ21Wtg==","signatures":[{"sig":"MEYCIQCsKM5xKJaoo9bV3hV1dHQNMyT67t5TTEqmzBmGXIenYAIhAN/YDIQopOGusZHhXzGgsx9PypUgkxX/D7QYaCAIHW0u","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDnf8uuGhJmya6pElJaxfnZnyQPy2hyBiMqadUzkkGaDAIgfNaUILATTe4xGzcmg2OZPZZvNmNcjto57tfMtDsQaWs="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@jsonjoy.com%2ffs-node-to-fsa@4.68.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":126251,"size":24422,"noattachment":false,"key":"/@jsonjoy.com/fs-node-to-fsa/-/@jsonjoy.com/fs-node-to-fsa-4.68.2.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","name":"@jsonjoy.com/fs-node-to-fsa","_from":"file:package.tgz","types":"lib/index.d.ts","author":{"url":"https://github.com/streamich","name":"streamich"},"engines":{"node":">=10.0"},"funding":{"url":"https://github.com/sponsors/streamich","type":"github"},"license":"Apache-2.0","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","version":"4.68.2","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0f95ece2-95ae-401c-bb20-e8975d19b288"}},"homepage":"https://github.com/streamich/memfs/tree/master/packages/fs-node-to-fsa","keywords":["fs","filesystem","fsa","file-system-access","node-to-fsa","adapter"],"_resolved":"/home/runner/work/memfs/memfs/packages/fs-node-to-fsa/package.tgz","_integrity":"sha512-4O1K4w5G4oJIpKpoa3WSLG83AsQYVnGv+aUSBGOvIUph9Axm6bB1mPlvldkNg2tBx/4dkiTlZnqNrK5SQ21Wtg==","repository":{"url":"git+https://github.com/streamich/memfs.git","type":"git"},"_npmVersion":"11.17.0","description":"Adapter to convert Node.js fs API to File System Access API","directories":{},"maintainers":[{"name":"json-joy-team","email":"team@jsonjoy.com"},{"name":"streamich","email":"vadimsdaleckis@gmail.com"}],"_nodeVersion":"24.19.0","dependencies":{"@jsonjoy.com/fs-fsa":"4.68.2","@jsonjoy.com/fs-node-utils":"4.68.2","@jsonjoy.com/fs-node-builtins":"4.68.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","memfs":"4.68.2","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.68.2"},"peerDependencies":{"tslib":"2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fs-node-to-fsa_4.68.2_1787997778143_0.4273294919725945"},"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":1787997778232,"_cnpm_publish_time":1787997778232,"dist-tags":{"latest":"4.80.1"}}