|
|
il y a 1 jour | |
|---|---|---|
| .. | ||
| README.md | il y a 1 jour | |
This demo shows how to run Git in a browser while writing to a real folder on
the user's device. It uses the File System Access API to select a folder,
memfs to expose that folder through a Node.js fs-like API, and
isomorphic-git to run Git commands.
The first time a folder is selected, the demo creates a repository in its
repo subdirectory, writes and stages a README.md, and creates an initial
commit. The selected directory handle is saved in IndexedDB. On later visits,
the demo reopens the repository or asks the user to restore permission with a
button click.
https://github.com/streamich/memfs/assets/9773803/c15212e8-3ee2-4d2a-b325-9fbdcc377c12
From the repository root:
yarn build
yarn workspace memfs demo:git-fsa
Open http://localhost:9876 in Chrome or Edge. Browsers treat localhost as a
secure context for the File System Access API.
repo/README.md and
a repo/.git directory.