109

GitHub - posquit0/node-giga: ? Easy streaming upload and download for File Syste...

 6 years ago
source link: https://github.com/posquit0/node-giga
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Giga

Storage-agnostic streaming upload/download in Node.js


Giga is an abstract storage class to easily streaming upload and download files to Local File System, AWS S3, and more.

  • It was written for use on OMNIOUS which provides fashion A.I API service.

Installation

# NPM
$ npm install --save giga
# Yarn
$ yarn add giga

Usage

const fs = require('fs');
const Giga = require('giga');
const S3Storage = require('giga/storages/S3Storage');
const LocalStorage = require('giga/storages/LocalStorage');

const storage = new Giga({
  storage: new S3Storage({
    region: 'ap-northeast-2',
    bucket: 'test'
  })
});


// Upload file to S3
const { filePath } = await storage.upload(fs.createReadStream('./my-file'));

// Download file from S3
const { filePath } = await storage.download(
  'hello-world.txt',
  fs.createWriteStream('./my-file')
);

Contributing

This project follows the Contributor Covenant Code of Conduct.

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or ask feature requests.

Contact

If you have any questions, feel free to join me at #posquit0 on Freenode and ask away. Click here to connect.

License

MIT © Byungjin Park


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK