https://github.com/streamich/webfs.js
Node `fs` API in browser on top of OPFS
https://github.com/streamich/webfs.js
Last synced: 4 months ago
JSON representation
Node `fs` API in browser on top of OPFS
- Host: GitHub
- URL: https://github.com/streamich/webfs.js
- Owner: streamich
- Created: 2025-08-02T10:15:59.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-09-05T12:03:42.000Z (10 months ago)
- Last Synced: 2025-10-29T07:34:16.175Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 1010 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# webfs.js
Node.js `fs` API in browser on top of OPFS (Origin Private File System).
This TypeScript library provides a familiar Node.js filesystem interface for browser environments using the Origin Private File System API.
## Usage
Simply load `webfs.js` in your browser environment:
```html
```
and then you will have access to the `fs` object that mimics Node.js `fs` API:
```javascript
const fs = window.fs;
fs.writeFile('/path/to/file.txt', 'Hello, World!')
.then(() => {
console.log('File written successfully');
})
.catch((err) => {
console.error('Error writing file:', err);
});
```
[See live demo](https://jsfiddle.net/mos4ua9d/2/).