{"id":16625780,"url":"https://github.com/aleclarson/fsx-mock","last_synced_at":"2026-04-25T02:35:00.954Z","repository":{"id":66177708,"uuid":"114421646","full_name":"aleclarson/fsx-mock","owner":"aleclarson","description":null,"archived":false,"fork":false,"pushed_at":"2018-12-15T07:44:54.000Z","size":8,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-25T14:55:43.297Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/aleclarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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":"2017-12-16T00:16:46.000Z","updated_at":"2020-09-19T04:19:45.000Z","dependencies_parsed_at":"2023-02-20T23:16:02.507Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/fsx-mock","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"6da6b3ff10f96e007deddb91e0967beaf2663a17"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aleclarson/fsx-mock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx-mock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx-mock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx-mock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx-mock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/fsx-mock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Ffsx-mock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32247926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"online","status_checked_at":"2026-04-25T02:00:06.260Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-12T04:07:09.857Z","updated_at":"2026-04-25T02:35:00.925Z","avatar_url":"https://github.com/aleclarson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# fsx-mock v0.2.0\n\nThis library provides an in-memory layer on top of an actual\nfilesystem. The methods of [`fsx`](https://github.com/aleclarson/fsx)\nare replaced with functions that operate on the in-memory filesystem,\nthough the actual filesystem may be accessed (but never mutated).\n\n### Features\n\n- All changes are only accessible using this library.\n- Real files/directories can be \"removed\", but in reality, they\nare left untouched.\n- Errors are the same as using the real API (including error codes).\n- Call the `reset` method to revert all changes!\n\nCheck out [`fsx`](https://github.com/aleclarson/fsx) for details on the API.\n\n### Usage\n\n```js\nconst mockFs = require('fsx-mock')\n\n// If no working directory is passed, `process.cwd()` is used.\nconst fs = mockFs.install('/path/to/cwd')\n\n// Non-absolute paths are resolved relative to the working directory.\nfs.writeFile('foo', 'hello world')\n\n// This will equal true.\nfs.readFile('/path/to/cwd/foo') == 'hello world'\n\n// Revert changes to 'foo'\nfs.reset('foo')\n\n// This will now throw an error.\nfs.readFile('foo')\n\n// Revert all changes to the filesystem.\nfs.reset()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Ffsx-mock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Ffsx-mock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Ffsx-mock/lists"}