0.1.7 • Published 1 year ago
@zenfs/fetch v0.1.7
ZenFS Fetch Backend
A ZenFS backend for fetching files using HTTP.
!IMPORTANT Please read the ZenFS core documentation
For more information, see the API documentation.
Usage
!NOTE 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 ZenFS Fetch via the globalZenFS_Fetch
object.
import { configure, fs } from '@zenfs/core';
import { Fetch } from '@zenfs/fetch';
await configure({ backend: Fetch, baseUrl: 'https://example.com/' });
const contents = await fs.readFile('/test.txt', 'utf-8');
console.log(contents);