Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
md-tiny-storage-client
Advanced tools
Tiny node client to request distributed AWS S3 or the OpenStack Swift Object Storage.
Readme
High availability, Performances, and Simplicity are the main focus of this tiny Node client to request AWS S3 API or the OpenStack Swift Object Storage API. It was initially made to request OVHCloud, but it can be used for any Server/Cloud provider.
uploadFile
, downloadFile
, deleteFile
, listFiles
, listBuckets
, headBucket
, setFileMetadata
, getFileMetadata
, deleteFiles
and request
for custom requests.Objects
/Arrays
(Concerns only: listFiles
, listBuckets
and Errors
).Install and setup in less than 2 minutes:
Swift API | S3 API | Method | Description |
---|---|---|---|
✅ example | ✅ example | uploadFile | Upload a file from a Buffer or file absolute path. |
✅ example | ✅ example | downloadFile | Download a file as Buffer or Stream |
✅ example | ✅ example | deleteFile | Delete a file |
✅ example | ✅ example | deleteFiles | Bulk delete files (1000 max/per request) |
✅ example | ✅ example | listFiles | List files (1000 max/per requests) use query parameters for pagination |
✅ example | ✅ example | getFileMetadata | Fetch custom metadatas |
✅ example | ✅ example | setFileMetadata | Set custom file metadatas |
✅ example | ✅ example | headBucket | Determine if a bucket exists and you have permission to access it |
✅ example | ✅ example | listBuckets | Returns a list of all buckets owned by the authenticated sender of the request. |
✅ example | ✅ example | request | Create custom requests |
✅ example | ❌ | connection | Connection is required only for Openstack Swift Object storage to get a unique auth token |
✅ example | ✅ example | Bucket Alias | Simplify requests by using bucket alias |
The following exemple is an initialisation of the SDK client with a list of S3 credentials and a request to download a file. If something goes wrong when downloading the file, the SDK will switch storage and retry to download with the second credentials. As soon as the first storage is available, the SDK returns to the main storage
const storageClient = require('tiny-storage-client');
const s3storage = storageClient([{
accessKeyId : 'accessKeyId',
secretAccessKey: 'secretAccessKey',
url : 's3.gra.io.cloud.ovh.net',
region : 'gra'
},
{
accessKeyId : 'accessKeyId',
secretAccessKey: 'secretAccessKey',
url : 's3.eu-west-3.amazonaws.com',
region : 'eu-west-3'
}])
s3storage.downloadFile('bucketName', 'filename.pdf', (err, resp) => {
if (err) {
return console.log("Error on download: ", err);
}
/**
* Request reponse:
* - resp.body => downloaded file as Buffer
* - resp.headers
* - resp.statusCode
*/
})
Install
$ npm install
To run all the tests:
$ npm run test
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
This packaged in maintained by Carbone:
FAQs
Tiny node client to request distributed AWS S3 or the OpenStack Swift Object Storage.
The npm package md-tiny-storage-client receives a total of 8 weekly downloads. As such, md-tiny-storage-client popularity was classified as not popular.
We found that md-tiny-storage-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.