From 2e68537326a1af21a9a62a75b348096aab396691 Mon Sep 17 00:00:00 2001 From: James P Date: Fri, 19 Apr 2024 18:00:12 -0500 Subject: [PATCH] Fixed readme --- readme.md | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/readme.md b/readme.md index 5912e12..a8f835e 100644 --- a/readme.md +++ b/readme.md @@ -14,42 +14,4 @@ npm install @zenfs/emscripten ## Usage -> 🛈 The examples are written in ESM. If you are using CJS, you can `require` the package. If running in a browser you can add a script tag to your HTML pointing to the `browser.min.js` and use ZenFS DOM via the global `ZenFS_Emscripten` object. - -You can use DOM backends, though you must register them if you plan on using `configure`: - -Main thread: - -```js -import { PortFS } from '@zenfs/port'; - -// Listen for remote file system requests. -PortFS.attachRemoteListener(portObject); -``` - -Port thread: - -```js -import { configure } from '@zenfs/core'; -import { Port } from '@zenfs/port'; - -// Set the remote file system as the root file system. -await configure({ - backend: 'PortFS', - port: self, -}); -``` - -```js -import { configure } from '@zenfs/core'; -import { Port } from '@zenfs/port'; - -await configure({ backend: , port: seld ); - -if (!fs.existsSync('/test.txt')) { - fs.writeFileSync('/test.txt', 'This will persist across reloads!'); -} - -const contents = fs.readFileSync('/test.txt', 'utf-8'); -console.log(contents); -``` +> 🛈 The examples are written in ESM. If you are using CJS, you can `require` the package. If running in a browser you can add a script tag to your HTML pointing to the `browser.min.js` and use ZenFS Emscripten via the global `ZenFS_Emscripten` object. \ No newline at end of file