0.0.1 • Published 2 months ago
@browserfs/fetch v0.0.1
BrowserFS Fetch Backend
A BrowserFS backend for fetching files using HTTP.
Please read the BrowserFS documentation!
For more information, see the API documentation.
Installing
npm install @browserfs/fetch
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 thebrowser.min.js
and use BrowserFS Fetch via the globalBrowserFS_Fetch
object.
import { configure, fs } from '@browserfs/core';
import { Fetch } from '@browserfs/fetch';
await configure({ backend: Fetch, baseUrl: 'https://example.com/' });
const contents = await fs.readFile('/test.txt', 'utf-8');
console.log(contents);
0.0.1
2 months ago