# express-rest-fs

> Exposes your filesystem as a REST API

Latest version **0.1.0** (published 2018-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-rest-fs
pnpm add express-rest-fs
yarn add express-rest-fs
bun add express-rest-fs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2018-10-21 |
| First published | 2018-10-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Lukas Prasuhn |
| Maintainers | lukasjapan |
| Keywords | filesystem, rest, api, fs, follow |

## Links

- npm: https://www.npmjs.com/package/express-rest-fs
- Repository: https://github.com/lukasjapan/express-rest-fs
- npm.io page: https://npm.io/package/express-rest-fs

## Dependencies (3)

- [tail](https://npm.io/package/tail.md) ^0.3.5
- [express](https://npm.io/package/express.md) ^4.3.2
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.21

## 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.1.0 (latest) — 2018-10-21
- 0.0.6 — 2018-10-20
- 0.0.5 — 2018-10-20
- 0.0.4 — 2018-10-20
- 0.0.3 — 2018-10-20

## README

## ExpressRestFs

Let's RESTify your filesystem

## Usage

`./bin/expose [path] [port]` will serve path (~ by default) at port (8000 by default).

As _expressRestFs_ has been built as an express middleware, you can use it in your existing express application.

```javascript
var express = require("express");
var app = express();

var expressRestFs = require("express-rest-fs");

app.use("/fs", expressRestFs({ basepath: "/home/" }));

/* your routing definition */

app.listen(8000);
```

The code above will serve your `home` directory under `/fs` url.

## Exposed API

| action                     | verb     | operation | note                           |
| -------------------------- | -------- | --------- | ------------------------------ |
| List Directory             | `GET`    | readdir   |
| Retrieve file              | `GET`    | read      |
| Stat file                  | `GET`    | stat      | must use `?stat`               |
| Create File                | `POST`   | write     |
| Create Directory           | `POST`   | mkdir     | file name must finish with `/` |
| Append to File             | `PUT`    | write     |
| Update file timestamps     | `PATCH`  | utimes    |
| Remove a file or directory | `DELETE` | unlink    |

## TODO:

- Testing
- Rethink status codes/responses
- Caching headers
- Resume
- ...

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