{"id":15356943,"url":"https://github.com/antfu/fs-spy","last_synced_at":"2025-04-13T00:46:48.828Z","repository":{"id":41909453,"uuid":"484208902","full_name":"antfu/fs-spy","owner":"antfu","description":"Monitoring fs accessing for Node process","archived":false,"fork":false,"pushed_at":"2025-02-12T07:12:39.000Z","size":85,"stargazers_count":174,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T00:46:42.899Z","etag":null,"topics":["filesystem","fs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antfu.png","metadata":{"funding":{"github":["antfu"],"open_collective":"antfu"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-21T21:22:50.000Z","updated_at":"2025-03-01T15:52:15.000Z","dependencies_parsed_at":"2025-03-21T03:01:20.754Z","dependency_job_id":"446683bd-9200-4cff-9b4d-342af8e24c19","html_url":"https://github.com/antfu/fs-spy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Ffs-spy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Ffs-spy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Ffs-spy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antfu%2Ffs-spy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antfu","download_url":"https://codeload.github.com/antfu/fs-spy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650434,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filesystem","fs"],"created_at":"2024-10-01T12:31:03.682Z","updated_at":"2025-04-13T00:46:48.806Z","avatar_url":"https://github.com/antfu.png","language":"TypeScript","funding_links":["https://github.com/sponsors/antfu","https://opencollective.com/antfu"],"categories":[],"sub_categories":[],"readme":"# fs-spy\n\n[![NPM version](https://img.shields.io/npm/v/fs-spy?color=a1b858\u0026label=)](https://www.npmjs.com/package/fs-spy)\n\nMonitoring fs accessing for Node process\n\n## Install\n\n```bash\nnpm i -D fs-spy\n```\n\n## Usage\n\n```bash\nnode -r fs-spy my-module.js\n```\n\nFor wrapped CLIs:\n\n```bash\n# NODE_OPTIONS=--require=fs-spy \u003ccommand\u003e\nNODE_OPTIONS=--require=fs-spy rollup -c\n```\n\n\u003cimg width=\"495\" alt=\"image\" src=\"https://user-images.githubusercontent.com/11247099/164841468-c805fcc0-0cc5-4724-8d38-7c2d8866ea1d.png\"\u003e\n\nOn the process exit, you will get the accessed file tree report and a generated `.fs-spy.json` file under your current working directory.\n\n## Debugging\n\nYou can use `fs-spy` to debug why certain file has be accessed by using the hook. For example\n\n```ts\nimport spy from 'fs-spy'\n\nspy.onFileEvent((event, filepath) =\u003e {\n  if (filepath.endsWith('.json'))\n    throw new Error('See the stack trace')\n})\n```\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg\"\u003e\n    \u003cimg src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\n[MIT](./LICENSE) License © 2022 [Anthony Fu](https://github.com/antfu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantfu%2Ffs-spy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantfu%2Ffs-spy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantfu%2Ffs-spy/lists"}