{"id":16665890,"url":"https://github.com/morinokami/webcontainer-fst","last_synced_at":"2026-03-12T03:32:39.953Z","repository":{"id":77641089,"uuid":"603469122","full_name":"morinokami/webcontainer-fst","owner":"morinokami","description":"Create a WebContainer-compatible FileSystemTree from a given path","archived":false,"fork":false,"pushed_at":"2024-08-13T13:58:51.000Z","size":172,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T00:40:49.450Z","etag":null,"topics":["nodejs","stackblitz","webcontainer"],"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/morinokami.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":"2023-02-18T15:59:29.000Z","updated_at":"2025-03-24T08:06:18.000Z","dependencies_parsed_at":"2024-10-28T11:39:30.171Z","dependency_job_id":null,"html_url":"https://github.com/morinokami/webcontainer-fst","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"40557582c9551e79430f56cf7f77f567ef2cdbe6"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/morinokami/webcontainer-fst","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morinokami%2Fwebcontainer-fst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morinokami%2Fwebcontainer-fst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morinokami%2Fwebcontainer-fst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morinokami%2Fwebcontainer-fst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morinokami","download_url":"https://codeload.github.com/morinokami/webcontainer-fst/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morinokami%2Fwebcontainer-fst/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30414318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T00:40:14.898Z","status":"online","status_checked_at":"2026-03-12T02:00:07.260Z","response_time":114,"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":["nodejs","stackblitz","webcontainer"],"created_at":"2024-10-12T11:09:15.034Z","updated_at":"2026-03-12T03:32:39.935Z","avatar_url":"https://github.com/morinokami.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webcontainer-fst\n\nwebcontainer-fst creates a WebContainer-compatible [FileSystemTree](https://webcontainers.io/api#filesystemtree) from a given path.\n\n[Demo](https://stackblitz.com/edit/webcontainer-fst-demo?file=build-files.js)\n\nSuppose the directory you want to [mount](https://webcontainers.io/api#%E2%96%B8-mount) on WebContainer has the following file structure:\n\n```\nsrc\n├── index.js\n└── package.json\n```\n\nTo obtain the FileSystemTree corresponding to this `src` directory, execute the `createFst` function as follows:\n\n```sh\n$ cat build-files.js \nimport { createFst } from 'webcontainer-fst';\n\nconst fst = await createFst('./src');\nconsole.log(JSON.stringify(fst, null, 2));\n\n$ node build-files.js \n{\n  \"index.js\": {\n    \"file\": {\n      \"contents\": \"import express from 'express';\\nconst app = express();\\nconst port = 3111;\\n\\napp.get('/', (req, res) =\u003e {\\n  res.send('Welcome to a WebContainers app! 🥳');\\n});\\n\\napp.listen(port, () =\u003e {\\n  console.log(`App is live at http://localhost:${port}`);\\n});\"\n    }\n  },\n  \"package.json\": {\n    \"file\": {\n      \"contents\": \"{\\n  \\\"name\\\": \\\"example-app\\\",\\n  \\\"type\\\": \\\"module\\\",\\n  \\\"dependencies\\\": {\\n    \\\"express\\\": \\\"latest\\\",\\n    \\\"nodemon\\\": \\\"latest\\\"\\n  },\\n  \\\"scripts\\\": {\\n    \\\"start\\\": \\\"nodemon index.js\\\"\\n  }\\n}\"\n    }\n  }\n}\n```\n\nThe `fst` variable created here can be saved to a file and later mounted on WebContainer.\n\n## Installation\n\n```sh\nnpm install webcontainer-fst\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorinokami%2Fwebcontainer-fst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorinokami%2Fwebcontainer-fst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorinokami%2Fwebcontainer-fst/lists"}