Socket
Socket
Sign inDemoInstall

adonis-datadrive

Package Overview
Dependencies
1
Maintainers
4
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    adonis-datadrive

Extended drive provider for AdonisJs


Version published
Weekly downloads
5
decreased by-50%
Maintainers
4
Install size
3.38 MB
Created
Weekly downloads
 

Changelog

Source

0.5.1 (2021-09-24)

Bug Fixes

  • add types in adonis-typings (#16) (2cdb4ed)

Readme

Source

Adonis DataDrive

Extended drive provider for AdonisJS 5.

Zakodium logo

Maintained by Zakodium

NPM version build status npm download

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

Installation

npm i adonis-datadrive
node ace configure adonis-datadrive

Usage

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

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

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

Examples

Upload file

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

Keywords

FAQs

Last updated on 24 Sep 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc