HTTP Filesystem
Expose filesystem via HTTP and access it from the other side!
This module works best with memory-fs.
Install
Install package:
yarn add htfs
OR
npm install htfs
Server
Serving real fs is not a good idea. In this example we serve a virtual filesystem.
const HTTPFSMiddleware = const express = const MFS = // Create a new express app listening on port 8080const app = app // Create a new Virtual FileSystem with a test fileconst mfs = mfsmfs // Create and register fs middlewareapp
You can now browse filesystem with broweser: http://localhost:8080/mfs/
Client
Supported methods:
exists(path): Promise<Boolean>
readFile(path): Promise<String>
const HTTPFSAClient = const fs = endpoint: 'http://localhost:8080/mfs' fs
Options
endpoint
Required. HTTP URL of server.
License
MIT. Made with 💖