1.0.6 • Published 3 years ago

@sproutasia/sprout-filesystem-api v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Simplified Filesystem function for Sprout Apps

Key features

  • MongoDB GridFS integration
    • Get File
    • Upload File
    • Delete File

Installation

1.Install package

To install sprout-basis-api with npm:

npm install @sproutasia/sprout-filesystem-api --save

To install sprout-basis-api with yarn:

yarn add @sproutasia/sprout-filesystem-api --save

Usage

Here is a basic example of using sprout-filesystem-api within a nodejs application.

const SproutFilesystem = require("@sproutasia/sprout-filesystem-api");
const filesystemAPI = new SproutFilesystem("<TypeGoesHere>", {
  /*Options goes here*/
});

// Get File
filesystemAPI.download("<PasteFileIDHere>");

// Upload File
const file = fs.createReadStream("./toBeUploadedFile");
filesystemAPI.upload(file);

// delete File
filesystemAPI.delete("<PasteFileIDHere>");
1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago