# adonis-datadrive

> Extended drive provider for AdonisJs

Latest version **0.5.1** (published 2021-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install adonis-datadrive
pnpm add adonis-datadrive
yarn add adonis-datadrive
bun add adonis-datadrive
```

## Health

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

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

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.1 |
| Published | 2021-09-24 |
| First published | 2019-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 27.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Michaël Zasso |
| Maintainers | stropitek, targos, lpatiny, zakodium-bot |
| Keywords | adonisjs, adonis, drive, datadrive, provider |

## Links

- npm: https://www.npmjs.com/package/adonis-datadrive
- Repository: https://github.com/zakodium/adonis-datadrive
- Homepage: https://github.com/zakodium/adonis-datadrive#readme
- Issues: https://github.com/zakodium/adonis-datadrive/issues
- npm.io page: https://npm.io/package/adonis-datadrive

## Dependencies (1)

- [@types/node](https://npm.io/package/@types/node.md) ^16.7.10

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.5.1 (latest) — 2021-09-24
- 0.5.0 — 2021-09-23
- 0.4.0 — 2021-09-01
- 0.3.0 — 2021-07-07
- 0.2.0 — 2021-06-17
- 0.1.4 — 2021-03-23
- 0.1.3 — 2020-07-31
- 0.1.2 — 2020-07-31
- 0.1.1 — 2019-12-02
- 0.1.0 — 2019-12-02

## README

# Adonis DataDrive

Extended drive provider for AdonisJS 5.

<h3 align="center">

  <a href="https://www.zakodium.com">
    <img src="https://www.zakodium.com/brand/zakodium-logo-white.svg" width="50" alt="Zakodium logo" />
  </a>

  <p>
    Maintained by <a href="https://www.zakodium.com">Zakodium</a>
  </p>

[![NPM version][npm-image]][npm-url]
[![build status][ci-image]][ci-url]
[![npm download][download-image]][download-url]

| :warning: This module is unstable and in active development. Use at your own risk. |
| ---------------------------------------------------------------------------------- |

</h3>

## Installation

```console
npm i adonis-datadrive
node ace configure adonis-datadrive
```

## Usage

```js
import DataDrive from '@ioc:Zakodium/DataDrive';

const drive = DataDrive.use('myDrive');

// drive.put('myfile.txt', 'mycontent').then(...);
```

## Examples

### Upload file

```js
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';

// Library importation
import DataDrive from '@ioc:Zakodium/DataDrive';

export default class FilesController {
  public async upload({ request, params }: HttpContextContract) {
    const { filename } = params;
    request.multipart.onFile(filename, {}, async (file) => {
      // Saves the file
      await DataDrive.use('dir').put(filename, file);
    });
    await request.multipart.process();
    return `${filename} uploaded`;
  }
}
```

## License

[MIT](./LICENSE)

[npm-image]: https://img.shields.io/npm/v/adonis-datadrive.svg
[npm-url]: https://www.npmjs.com/package/adonis-datadrive
[ci-image]: https://github.com/zakodium/adonis-datadrive/workflows/Node.js%20CI/badge.svg?branch=main
[ci-url]: https://github.com/zakodium/adonis-datadrive/actions?query=workflow%3A%22Node.js+CI%22
[download-image]: https://img.shields.io/npm/dm/adonis-datadrive.svg
[download-url]: https://www.npmjs.com/package/adonis-datadrive

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