This package is a S3 client for NodeJs 8.X or greater. KilatStorageS3 uses a bash command to run s3cmd which has been configured and connected to the kilatstorage service. You can use this package for Amazon S3 service too.
This package created by Yudha Pratama If you found bugs or errors, you can report at Github Issue or send a direct message to my twitter.
If you like this project, please support us to give a Coffee
- KilatStorageS3 requires NodeJs 8.X or greater
- s3cmd (already configured with kilatstorage service) - You can read this for more information.
npm i s3-kilatstorage
const kilatstorage = require('s3-kilatstorage');
kilatstorage.makeBucket('bucket-name')
.then((status) => {
res.json(status);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.removeBucket('bucket-name')
.then((status) => {
res.json(status);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.listBuckets()
.then((list) => {
res.json(list);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.listAllObject()
.then((list) => {
res.json(list);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.putObjectPrivate('path-file', 'bucket-name')
.then((privateUrl) => {
res.json(privateUrl);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.putObjectPublic('path-file', 'bucket-name')
.then((publicUrl) => {
res.json(publicUrl);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.syncFolder('bucket-path', 'path-folder')
.then();
const kilatstorage = require('s3-kilatstorage');
kilatstorage.downloadObject('bucket-path', 'local-path-directory')
.then((status) => {
res.json(status);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.removeObject('bucket-path')
.then((status) => {
res.json(status);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.listObject('bucket-name')
.then((list) => {
res.json(list);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.existsObject('bucket-name', 'file-name')
.then((status) => {
res.json(status);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.diskUsage()
.then((list) => {
res.json(list);
});
const kilatstorage = require('s3-kilatstorage');
kilatstorage.diskUsage('bucket-name')
.then((list) => {
res.json(list);
});