{"id":13773738,"url":"https://github.com/ericvicenti/react-fs-renderer","last_synced_at":"2025-04-23T00:32:30.101Z","repository":{"id":146807578,"uuid":"81584021","full_name":"ericvicenti/react-fs-renderer","owner":"ericvicenti","description":"Declaratively render a tree of files with JSX","archived":false,"fork":false,"pushed_at":"2017-02-10T16:52:14.000Z","size":30,"stargazers_count":110,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T20:31:21.204Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-fs-renderer","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericvicenti.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}},"created_at":"2017-02-10T16:31:39.000Z","updated_at":"2024-06-03T17:50:27.000Z","dependencies_parsed_at":"2024-01-15T03:41:19.045Z","dependency_job_id":null,"html_url":"https://github.com/ericvicenti/react-fs-renderer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvicenti%2Freact-fs-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvicenti%2Freact-fs-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvicenti%2Freact-fs-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvicenti%2Freact-fs-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericvicenti","download_url":"https://codeload.github.com/ericvicenti/react-fs-renderer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348402,"owners_count":21415894,"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":[],"created_at":"2024-08-03T17:01:19.589Z","updated_at":"2025-04-23T00:32:30.078Z","avatar_url":"https://github.com/ericvicenti.png","language":null,"funding_links":[],"categories":["File","Others"],"sub_categories":[],"readme":"# React FS Renderer [![CircleCI](https://circleci.com/gh/ericvicenti/react-fs-renderer.svg?style=svg)](https://circleci.com/gh/ericvicenti/react-fs-renderer)\n\nTired of using an imperitive API to manipulate a tree of output? React gives us a great declarative interface for browser DOMs and native view heirarchies, but it doesn't help output a directory of files with a given format.. until now!\n\nFirst, install it (and you'll also need React):\n\n```\nnpm install --save react react-fs-renderer\n```\n\nYou'll need to compile JSX- see [this gist for the exact setup to do so](https://gist.github.com/ericvicenti/4a10c1349ba4ab0e4f6e6e2f95cfcfd8). Now you can use it:\n\n```js\nimport React from 'react';\nimport {\n  renderToFS,\n} from 'react-fs-renderer';\n\n\nconst JSONFile = ({ name, json }) =\u003e (\n  \u003cfile\n    name={`${name}.json`}\n    children={JSON.stringify(json)}\n  /\u003e\n);\n\nconst MyProjectTemplate = ({ name, displayName }) =\u003e (\n  \u003cfolder\u003e\n    \u003cJSONFile name=\"app\" json={{ name, displayName }} /\u003e\n    \u003cJSONFile name=\"package\" json={{\n      name,\n      version: '0.0.0',\n      main: 'src/${}.js',\n      dependencies,\n    }} /\u003e\n    \u003cfolder name=\"src\"\u003e\n      \u003cfile name={`${name}.js`} children={mainFileContent} /\u003e\n    \u003c/folder\u003e\n  \u003c/folder\u003e\n);\n\n\nrenderToFS(\n  \u003cMyProjectTemplate\n    displayName=\"My Great App\"\n    name=\"GreatApp\"\n  /\u003e,\n  './testDir'\n);\n```\n\nThis will create the following file tree:\n\n```\n./testDir/app.json\n./testDir/package.json\n./testDir/src/GreatApp.js\n```\n\nNow you can use React to declaratively render to files :-)\n\n\n## About\n\nThis is a proof-of-concept implementation for the purpose of gathering feedback. If there is demand for this concept, I will maintain it and help move it to an organization for long-term stewardship.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvicenti%2Freact-fs-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericvicenti%2Freact-fs-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvicenti%2Freact-fs-renderer/lists"}