{"id":13686103,"url":"https://github.com/vue-reactivity/fs","last_synced_at":"2026-01-27T11:37:59.629Z","repository":{"id":125570468,"uuid":"296793528","full_name":"vue-reactivity/fs","owner":"vue-reactivity","description":"Reactive filesystem powered by @vue/reactivity","archived":false,"fork":false,"pushed_at":"2020-10-14T02:46:46.000Z","size":52,"stargazers_count":57,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-08T23:59:04.361Z","etag":null,"topics":["fs","reactive-fs","vue-reactivity","vue3"],"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/vue-reactivity.png","metadata":{"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},"funding":{"github":"antfu"}},"created_at":"2020-09-19T05:30:27.000Z","updated_at":"2025-03-31T13:23:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"d958fa5c-d888-4c96-a37e-49e9fab765ff","html_url":"https://github.com/vue-reactivity/fs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vue-reactivity/fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Ffs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Ffs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Ffs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Ffs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vue-reactivity","download_url":"https://codeload.github.com/vue-reactivity/fs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Ffs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fs","reactive-fs","vue-reactivity","vue3"],"created_at":"2024-08-02T14:01:06.429Z","updated_at":"2026-01-27T11:37:59.615Z","avatar_url":"https://github.com/vue-reactivity.png","language":"TypeScript","funding_links":["https://github.com/sponsors/antfu"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align='center'\u003e\n\u003cimg src='https://github.com/vue-reactivity/art/blob/master/svg/package-fs.svg?raw=true' height='250'\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\nReactive filesystem powered by \u003ca href=\"https://github.com/vuejs/vue-next/tree/master/packages/reactivity\"\u003e\u003ccode\u003e@vue/reactivity\u003c/code\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@vue-reactivity/fs\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@vue-reactivity/fs?color=43b883\u0026label=\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=@vue-reactivity/fs\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@vue-reactivity/fs?color=364a5e\u0026label=\" alt=\"npm bundle size\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Install\n\n\u003cpre\u003e\nnpm i @vue-reactivity/\u003cb\u003efs\u003c/b\u003e\n\u003c/pre\u003e\n\n### Usage\n\n\u003e Work only in Node.js\n\n#### Async usage\n\n```ts\nimport { useFile } from '@vue-reactivity/fs'\n\nconst fileRef = await useFile('messages.txt').waitForReady()\n\nconsole.log(fileRef.value) // output file content\n\nfileRef.value += 'Hello World' // append to file\n\nfileRef.value = 'Good Morning' // write to file\n```\n\n#### Callback usage\n\n```ts\nimport { useFile } from '@vue-reactivity/fs'\n\nuseFile('messages.txt')\n  .waitForReady()\n  .then(fileRef =\u003e {\n    console.log(fileRef.value) // output file content\n  })\n```\n\n#### Watch for file changes (via [`chokidar`](https://github.com/paulmillr/chokidar))\n\n```ts\nconst fileRef = useFile('messages.txt', { watchFileChanges: true })\n```\n\n#### `useJson`\n\n```ts\nimport { useJSON } from '@vue-reactivity/fs'\n\nconst data = useJSON('data.json', { initialValue: { foo: 'bar' }})\n\nconsole.log(data.value) // { foo: 'bar' }\n\ndata.value = { bar: 'foo' } // write to json file\n```\n\n#### Custom serializer\n\n```ts\nimport YAML from 'js-yaml'\nimport { useFileWithSerializer } from '@vue-reactivity/fs'\n\nexport function useYAML\u003cT\u003e(path: string, options: JSONSerializerOptions\u003cT\u003e = {}) {\n  return useFileWithSerializer\u003cT\u003e(\n    path,\n    {\n      ...options,\n      serialize: v =\u003e YAML.safeDump(v)\n      deserialize: v =\u003e YAML.safeLoad(v),\n    },\n  )\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvue-reactivity%2Ffs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvue-reactivity%2Ffs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvue-reactivity%2Ffs/lists"}