Gathering detailed insights and metrics for test-version_tiny-storage-client
Gathering detailed insights and metrics for test-version_tiny-storage-client
Gathering detailed insights and metrics for test-version_tiny-storage-client
Gathering detailed insights and metrics for test-version_tiny-storage-client
Tiny node client to request distributed AWS S3 or the OpenStack Swift Object Storage.
npm install test-version_tiny-storage-client
Typescript
Module System
Node Version
NPM Version
75.7
Supply Chain
99.1
Quality
76.9
Maintenance
100
Vulnerability
100
License
Support interface for Swift connection + update packages
Published on 13 Nov 2024
v3.2.0
Published on 11 Sept 2024
Fixed S3 region switch on Error
Published on 26 Feb 2024
Fix Swift auth
Published on 17 Aug 2023
Swift / S3 methods ISO
Published on 01 Aug 2023
Swift improvements
Published on 26 Jul 2023
JavaScript (100%)
Total Downloads
165
Last Day
2
Last Week
2
Last Month
11
Last Year
165
16 Stars
164 Commits
3 Forks
4 Watching
1 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
0.0.1
Package Id
test-version_tiny-storage-client@0.0.1
Unpacked Size
533.58 kB
Size
59.22 kB
File Count
22
NPM Version
10.7.0
Node Version
20.14.0
Publised On
18 Oct 2024
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
0%
2
Compared to previous week
Last month
-42.1%
11
Compared to previous month
Last year
0%
165
Compared to previous year
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
1const storageClient = require('tiny-storage-client');
2
3const s3storage = storageClient([{
4 accessKeyId : 'accessKeyId',
5 secretAccessKey: 'secretAccessKey',
6 url : 's3.gra.io.cloud.ovh.net',
7 region : 'gra'
8 },
9 {
10 accessKeyId : 'accessKeyId',
11 secretAccessKey: 'secretAccessKey',
12 url : 's3.eu-west-3.amazonaws.com',
13 region : 'eu-west-3'
14 }])
15
16s3storage.downloadFile('bucketName', 'filename.pdf', (err, resp) => {
17 if (err) {
18 return console.log("Error on download: ", err);
19 }
20 /**
21 * Request reponse:
22 * - resp.body => downloaded file as Buffer
23 * - resp.headers
24 * - resp.statusCode
25 */
26})
Install
1$ npm install
To run all the tests:
1$ 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:
No vulnerabilities found.
No security vulnerabilities found.