# directory-serve

> Command line tool to share the directory

Latest version **1.3.8** (published 2026-10-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install directory-serve
pnpm add directory-serve
yarn add directory-serve
bun add directory-serve
```

Provides the command `directory-serve`.

## Health

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

Positive: no vulnerabilities; recently updated; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 1.3.8 |
| Published | 2026-10-15 |
| First published | 2022-10-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0 |
| Dependencies | 9 |
| Unpacked size | 763.6 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 424 |
| Author | Abhijith v |
| Maintainers | abhijith_v |
| Keywords | file sharing, http, https, cli, http-server, https-server, android, ios, mobile, cli sharing, directory sharing, file serving, directory serving, mobile file sharing, share clipboard, receive file, send file, static, file, server |

## Links

- npm: https://www.npmjs.com/package/directory-serve
- Repository: https://github.com/cube-root/directory-serve
- Homepage: https://github.com/cube-root/directory-serve#readme
- Issues: https://github.com/cube-root/directory-serve/issues
- npm.io page: https://npm.io/package/directory-serve

## Dependencies (9)

- [os](https://npm.io/package/os.md) ^0.1.2
- [send](https://npm.io/package/send.md) ^0.18.0
- [yargs](https://npm.io/package/yargs.md) ^17.6.0
- [express](https://npm.io/package/express.md) ^4.18.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.1.0
- [parseurl](https://npm.io/package/parseurl.md) ^1.3.3
- [formidable](https://npm.io/package/formidable.md) ^2.0.1
- [query-string](https://npm.io/package/query-string.md) ^7.1.1
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.3.8 (latest) — 2026-10-15
- 1.3.7 — 2026-07-17
- 1.3.6 — 2022-11-27
- 1.3.5 — 2022-11-27
- 1.3.4 — 2022-11-27
- 1.3.3 — 2022-11-26
- 1.3.2 — 2022-11-20
- 1.3.1 — 2022-11-14
- 1.3.0 — 2022-11-08
- 1.2.1 — 2022-11-03
- 1.2.0 — 2022-10-31
- 1.1.6 — 2022-10-30
- 1.1.5 — 2022-10-29
- 1.1.4 — 2022-10-29
- 1.1.3 — 2022-10-27
- … 12 more at https://npm.io/package/directory-serve/versions

## README

# Directory Serve

<a href="https://www.producthunt.com/posts/directory-serve?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-directory&#0045;serve" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=365677&theme=light" alt="Directory&#0032;Serve - Open&#0032;source&#0032;CLI&#0032;to&#0032;send&#0032;and&#0032;receive&#0032;file | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>

Directory Serve is a CLI tool for securely browsing, sending, and receiving files
between computers, Android devices, and iOS devices on the same network.

## Installation

This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/). Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

```bash
npm install --global directory-serve
```

## Quick start

```bash
directory-serve /path/to/directory
```

Without a global installation:

```bash
npx directory-serve /path/to/directory
```

Share one file:

```bash
npx directory-serve /path/to/file.pdf
```

The command prints a local URL and QR code. Open the URL on a device connected
to the same network.

## Command reference

```text
directory-serve <path> [options]
```

| Option | Default | Description |
| --- | --- | --- |
| `-p`, `--port <number>` | `8989` | HTTP port used by the server. |
| `-u`, `--uploadFile <boolean>` | `true` | Enable or disable uploads. Use `--uploadFile=false` for read-only sharing. |
| `--username <name>` | none | Require HTTP Basic Authentication with this username. |
| `--password <password>` | none | Password used with `--username`. |
| `--delete <boolean>` | `false` | Allow clients to remove files and folders. |
| `--max-upload-mb <number>` | `100` | Maximum size of each uploaded file in megabytes. |
| `--allowed-types <extensions>` | all | Comma-separated upload extension allowlist without dots. |
| `--upload-rate-limit <number>` | `30` | Maximum upload requests per client per minute. |
| `--debug <boolean>` | `false` | Print additional diagnostic information. |
| `--help` | — | Display command help. |
| `--version` | — | Display the installed version. |

Boolean options accept forms such as `--delete`, `--delete=true`, and
`--uploadFile=false`.

## Command examples

Share the current directory:

```bash
npx directory-serve .
```

Use a different port:

```bash
npx directory-serve ~/Desktop --port 3000
```

Create a read-only share with uploads and deletion disabled:

```bash
npx directory-serve ~/Desktop --uploadFile=false
```

Allow clients to upload and delete content:

```bash
npx directory-serve ~/Desktop --uploadFile=true --delete=true
```

Require a username and password:

```bash
npx directory-serve ~/Desktop --username test --password 'a-strong-password'
```

Limit each uploaded file to 25 MB:

```bash
npx directory-serve ~/Desktop --max-upload-mb 25
```

Only accept images and PDF documents:

```bash
npx directory-serve ~/Desktop --allowed-types jpg,jpeg,png,webp,pdf
```

Limit each client to ten upload requests per minute:

```bash
npx directory-serve ~/Desktop --upload-rate-limit 10
```

Combine authentication and all upload safeguards:

```bash
npx directory-serve ~/Desktop \
  --username team \
  --password 'a-strong-password' \
  --max-upload-mb 50 \
  --allowed-types jpg,jpeg,png,pdf,zip \
  --upload-rate-limit 10
```

Enable diagnostics while using another port:

```bash
npx directory-serve ~/Desktop --port 3000 --debug=true
```

Display help or the installed version:

```bash
npx directory-serve --help
npx directory-serve --version
```

## Browser features

- Search and filter the current directory.
- Sort items by name, modification date, size, or type.
- Switch between list and grid layouts.
- Upload multiple files with queue and progress feedback.
- View current-folder size, item count, and upload limit.
- Use light mode by default or manually switch to persistent dark mode.

Search operates on the currently open folder. Clear the search field to restore
all items; the selected file/folder filter remains active until it is changed to
**All items**.

## For Developing

### Prerequisites

1. Node (>=12.0)

Clone the repository and install its dependencies:

```bash
git clone https://github.com/cube-root/directory-serve.git
```

```bash
npm install
```

```bash
npm run dev -- /path/to/directory
```

## For Contributing

[Contribution Guide](/docs/CONTRIBUTING.MD)

## Screenshot

### CLI

![screenshot](/docs/screenshots/terminal-screenshot.png?raw=true "Directory serve")

### Client

![screenshot](/docs/screenshots/directory-list.png?raw=true)
![screenshot](/docs/screenshots/browser_with_remove.png?raw=true)

### Client Auth

![screenshot](/docs/screenshots/basic-auth.png?raw=true)

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