@sproutasia/sprout-filesystem-api

1.0.6 • Public • Published

sprout-filesystem-api

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>");

Readme

Keywords

none

Package Sidebar

Install

npm i @sproutasia/sprout-filesystem-api

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

57.7 kB

Total Files

7

Last publish

Collaborators

  • bramfatdeli
  • pehon-sprout
  • ricoatsproutasia
  • regasprout