# restbox

> REST for CRUD file operations on dropbox

Latest version **4.0.1** (published 2024-03-16) · MIT license · 328 weekly downloads

## Install

```sh
npm install restbox
pnpm add restbox
yarn add restbox
bun add restbox
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2024-03-16 |
| First published | 2013-01-09 |
| Weekly downloads | 328 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 11 |
| Unpacked size | 15.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | coderaiser |
| Maintainers | coderaiser |
| Keywords | rest, crud, files, middleware, dropbox |

## Links

- npm: https://www.npmjs.com/package/restbox
- Repository: https://github.com/coderaiser/restbox
- Issues: https://github.com/coderaiser/restbox/issues
- npm.io page: https://npm.io/package/restbox

## Dependencies (11)

- [apart](https://npm.io/package/apart.md) ^2.0.1
- [debug](https://npm.io/package/debug.md) ^4.1.0
- [ponse](https://npm.io/package/ponse.md) ^7.0.0
- [router](https://npm.io/package/router.md) ^2.0.0-alpha.1
- [currify](https://npm.io/package/currify.md) ^4.0.0
- [pipe-io](https://npm.io/package/pipe-io.md) ^4.0.0
- [pullout](https://npm.io/package/pullout.md) ^5.0.1
- [readbox](https://npm.io/package/readbox.md) ^3.0.0
- [wraptile](https://npm.io/package/wraptile.md) ^3.0.0
- [try-to-catch](https://npm.io/package/try-to-catch.md) ^3.0.0
- [@cloudcmd/dropbox](https://npm.io/package/@cloudcmd/dropbox.md) ^5.0.1

## 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

- 4.0.1 (latest) — 2024-03-16
- 4.0.0 — 2024-03-16
- 3.0.0 — 2021-01-25
- 2.0.5 — 2020-07-03
- 2.0.4 — 2020-02-26
- 2.0.3 — 2020-02-21
- 2.0.2 — 2019-12-16
- 2.0.1 — 2019-10-16
- 2.0.0 — 2019-09-21
- 1.1.5 — 2019-09-19
- 1.1.4 — 2019-09-17
- 1.1.3 — 2019-09-11
- 1.1.2 — 2019-09-10
- 1.1.1 — 2018-11-29
- 1.1.0 — 2018-11-13
- … 7 more at https://npm.io/package/restbox/versions

## README

# Restbox [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage][CoverageIMGURL]][CoverageURL]

[NPMIMGURL]: https://img.shields.io/npm/v/restbox.svg?style=flat
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]: https://npmjs.org/package/restbox "npm"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"
[BuildStatusURL]: https://github.com/coderaiser/restbox//actions?query=workflow%3A%22Node+CI%22 "Build Status"
[BuildStatusIMGURL]: https://github.com/coderaiser/restbox/workflows/Node%20CI/badge.svg
[CoverageURL]: https://coveralls.io/github/coderaiser/restbox?branch=master
[CoverageIMGURL]: https://coveralls.io/repos/coderaiser/restbox/badge.svg?branch=master&service=github

**REST** for **CRUD** file operations on `dropbox`.

## What is it?

**RE**presentational **S**tate **T**ransfer is an abstraction of the architecture of the World Wide Web.

**C**reate **R**ead **U**pdate **D**elete is 4 basic functions of persistent storage.

## Install

`npm i restbox`

## REST

|Name         |Method   |Query          |Body               |Description                    |
|:------------|:--------|:--------------|:------------------|:------------------------------|
|`fs`         |`GET`    |               |                   |get file or dir content        |
|             |         |`sort`         |                   |sort dir content by `name`,    |
|             |         |               |                   |`size`, or `time`              |
|             |         |`order`        |                   |order of sorting, can be:      |
|             |         |               |                   |`asc` or `desc`                |
|             |         |`raw`          |                   |get file or raw dir content    |
|             |         |`size`         |                   |get file or dir size           |
|             |         |`time`         |                   |get time of file change        |
|             |         |`hash`         |                   |get file hash                  |
|             |`PUT`    |               |file content       |create/write file              |
|             |         | `unzip`       |file content       |unzip and create/write file    |
|             |         | `dir`         |                   |create dir                     |
|             |`PATCH`  |               |diff               |patch file                     |
|             |`DELETE` |               |                   |delete file                    |
|             |         |`files`        |Array of names     |delete files                   |

## How to use?

```js
const restbox = require('restbox');
const http = require('http');
const express = require('express');

const app = express();
const server = http.createServer(app);

const port = 1337;
const ip = '0.0.0.0';

app.use(restbox({
    token: 'your dropbox token',
    prefix: '/dropbox', // default
    root: '/', // default, can be string or function
}));

app.use(express.static(__dirname));

server.listen(port, ip);
```

## License

MIT

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