# file-sink-remote-http

> A file sink which accesses files via RESTful HTTP verbs

Latest version **2.0.1** (published 2026-03-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install file-sink-remote-http
pnpm add file-sink-remote-http
yarn add file-sink-remote-http
bun add file-sink-remote-http
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-03-26 |
| First published | 2023-07-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 180.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | dankolz |

## Links

- npm: https://www.npmjs.com/package/file-sink-remote-http
- npm.io page: https://npm.io/package/file-sink-remote-http

## Dependencies (3)

- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [@webhandle/minimal-browser-event-emitter](https://npm.io/package/@webhandle/minimal-browser-event-emitter.md) ^1.0.1
- [@webhandle/initialize-webhandle-component](https://npm.io/package/@webhandle/initialize-webhandle-component.md) ^1.0.2

## Recent versions

- 2.0.1 (latest) — 2026-03-26
- 2.0.0 — 2026-02-24
- 1.0.3 — 2024-04-16
- 1.0.2 — 2023-11-30
- 1.0.1 — 2023-11-28
- 1.0.0 — 2023-07-01

## README

# File Sink Remote HTTP
A file sink which accesses files via RESTful HTTP verbs

## Why

I want to use something else I wrote, [FileSink](https://www.npmjs.com/package/file-sink), to abstract
away just a little bit of the file system interface. I want callers to be able to read and write "files"
without needing to know where, specifically, on disk they're writing to, or even what they're really writing
to. It could be a file system, http, AWS S3, indexeddb, mongodb, or whatever. The caller shouldn't need to
know how to connect to the underlying resource, how to encrypt/decrypt, or anything more than the relative
path.

This is the bridge between a browser side FileSink and one on the web server which reads/writes the local
file system.

While I have some specific uses in mind for this, it also makes it really easy just to provide RESTful access
to files.

## Install

```
npm install file-sink-remote-http
```

## Usage

On the server side:

```js
import fileSinkRemoteHttpSetup from "file-sink-remote-http/initialize-webhandle-component.mjs"
let fileSinkRemoteHttpManager = await fileSinkRemoteHttpSetup(webhandle)

```

On the client side:

```js
import {FileSinkRemoteHttp} from "file-sink-remote-http"
let sink = new FileSinkRemoteHttp(`http://localhost:3000/test-data`)
let msg = (await sink.read('data1.txt')).toString()

```



Use the file sink methods to read and write data.

```js
const Sink = require('file-sink-remote-http')
let sink = new Sink(`http://localhost:3000/test-data`)

async function test() {
	let msg = (await sink.read('data1.txt')).toString()
	console.log(msg)
}

test()
```

---
_Source: https://npm.io/package/file-sink-remote-http · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
