1.1.4 • Published 15 days ago

@astram/node-helper v1.1.4

Weekly downloads
-
License
ISC
Repository
-
Last release
15 days ago

Astram Node Helper

All Common Helper Functions will be used using this library

Installation

Install node-helper using npm

$ cd <working_directory>
$ npm i @astram/node-helper

Helper Modules

S3 Module

This module is used to get all tasks related to S3 that includes following functionality

  • Upload Files
    • uploadToS3
      • Directly Upload File from local system/server to S3
    • uploadFromBuffer
      • Upload data/content to a file onto S3
    • uploadFromStream
      • Upload using stream
  • Get File
    • getAllFiles
      • Get all files of a folder
    • getFileLink
      • Get File as URL from S3 which is signed and will expires by default it is 5mins
    • downloadFromS3
      • Download File from S3 to local system or get content of file
  • Check File Existance
    • isFileExist
      • Check whether a file exists corresponding to a bucket or not
  • Delete File
    • deleteFile
      • Delete file from S3

Code Example

const { s3 } = require(`@astram/node-helper`);

const bucket = `astram-bucket`;

// check if file exists
const filePath = `test/test.pdf`;
const isFile = await s3.isFileExist(bucket, filePath);

// Get File Link
const filePath = `test/test.pdf`;
const isFile = await s3.getFileLink(bucket, filePath);

...
1.1.4

15 days ago

1.1.3

15 days ago

1.1.2

15 days ago

1.1.1

2 months ago

1.1.0

2 months ago

1.0.1

6 months ago

1.0.0

7 months ago