# @artesa/feathers-file-stream

> feathers.js plugin for file uploads and downloads with streams

Latest version **0.8.1** (published 2026-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @artesa/feathers-file-stream
pnpm add @artesa/feathers-file-stream
yarn add @artesa/feathers-file-stream
bun add @artesa/feathers-file-stream
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.8.1 |
| Published | 2026-06-08 |
| First published | 2022-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 22.0.0 |
| Dependencies | 2 |
| Unpacked size | 68.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Artesa |
| Maintainers | thenoim, fratzinger |
| Keywords | feathersjs, feathers-plugin, upload, file, stream, s3 |

## Links

- npm: https://www.npmjs.com/package/@artesa/feathers-file-stream
- Repository: https://github.com/Artesa/feathers-file-stream
- npm.io page: https://npm.io/package/@artesa/feathers-file-stream

## Dependencies (2)

- [mime-types](https://npm.io/package/mime-types.md) ^3.0.2
- [feathers-utils](https://npm.io/package/feathers-utils.md) ^10.0.2

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.8.1 (latest) — 2026-06-08
- 0.5.0-0 (pre) — 2022-11-13
- 0.8.0 — 2026-06-08
- 0.7.0 — 2025-11-14
- 0.6.0 — 2024-04-09
- 0.5.1 — 2023-02-03
- 0.5.0 — 2023-02-03
- 0.4.10 — 2022-11-16
- 0.4.9 — 2022-11-15
- 0.4.8 — 2022-11-15
- 0.4.7 — 2022-11-13
- 0.4.6 — 2022-11-13
- 0.4.5 — 2022-11-13
- 0.4.4 — 2022-11-13
- 0.4.3 — 2022-11-13
- … 19 more at https://npm.io/package/@artesa/feathers-file-stream/versions

## README

# feathers-file-stream

```shell
npm i @artesa/feathers-file-stream
```

This package relies on a few peer dependencies. `@feathersjs/feathers` and `@feathersjs/errors` are already part of any Feathers app, so you normally have them.

If you use the S3 service (`ServiceFileStreamS3`), also install the AWS SDK packages:

```shell
npm i @aws-sdk/client-s3 @aws-sdk/lib-storage
```

If you use the Express middleware (`expressHandleIncomingStreams`, `expressSendStreamForGet`), also install Express and Multer:

```shell
npm i express multer
```

These peers are optional: the filesystem service (`ServiceFileStreamFS`) needs neither the AWS SDK nor Express/Multer.

## Usage with express & multer@next (multer v2) with fs storage

```ts
import multer from "multer"; // multer v2 (!)
import {
  expressHandleIncomingStreams,
  ServiceFileStreamFS,
  expressSendStreamForGet
} from "@artesa/feathers-file-stream";
const multerInstance = multer();

app.use(
  "/uploads",
  multerInstance.array("files"),
  expressHandleIncomingStreams({ field: "files", isArray: true }),
  new ServiceFileStreamFS({
    root: path.join(__dirname, "uploads")
  }),
  expressSendStreamForGet()
);
```

## Usage with express & multer@next (multer v2) with s3

```ts
import multer from "multer"; // multer v2 (!)
import { S3Client } from "@aws-sdk/client-s3";
import {
  expressHandleIncomingStreams,
  ServiceFileStreamS3,
  expressSendStreamForGet
} from "@artesa/feathers-file-stream";
const multerInstance = multer();
const s3 = new S3Client({
  credentials: {
    accessKeyId: "",
    secretAccessKey: ""
  }
});

app.use(
  "/uploads",
  multerInstance.array("files"), // looks for files and puts them in req.files
  expressHandleIncomingStreams({ field: "files", isArray: true }), // looks for req.files and puts them in req.body, so that it arrives at the service data object in the create method
  new ServiceFileStreamS3({
    s3: new S3Client({
      credentials: {
        accessKeyId: "",
        secretAccessKey: ""
      }
    }),
    bucket: "my-bucket"
  }),
  expressSendStreamForGet() // pipes the stream for a get request to the response
);
```

## Upload a file with stream

```ts
app.service("uploads").create({
  id: "my-file.txt", // the filename to save
  stream: fs.createReadStream("my-file.txt") // the stream to read
});
```

---
_Source: https://npm.io/package/@artesa/feathers-file-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
