webcontainer-fs-promises
v0.0.7
Published
```Javascript import { WebContainer } from '@webcontainer/api'; import FsPromises from 'webcontainer-fs-promises'; const webcontainerInstance = await WebContainer.boot(); const fs = webcontainerInstance.fs; fs.promises = new FsPromises({fs:fs}); fs.promis
Downloads
24
Readme
fs.promises for web containers
round out webcontainerInstance.fs with stat and lstat
import { WebContainer } from '@webcontainer/api';
import FsPromises from 'webcontainer-fs-promises';
const webcontainerInstance = await WebContainer.boot();
const fs = webcontainerInstance.fs;
fs.promises = new FsPromises({fs:fs});
fs.promises.writeFile("hello.txt", "Hello World!");
Implements:
- fs.promises.readFile(path[, options])
- fs.promises.writeFile(file, data[, options])
- fs.promises.unlink(path)
- fs.promises.readdir(path[, options])
- fs.promises.mkdir(path[, mode])
- fs.promises.rmdir(path)
- fs.promises.stat(path[, options])
- fs.promises.lstat(path[, options])
- fs.promises.rm(path[, options])
I built this because I need it with isomorphic git.