fix(core): update
This commit is contained in:
parent
2a17ee542e
commit
cb0ab2c9db
@ -8,29 +8,27 @@
|
|||||||
"githost": "code.foss.global",
|
"githost": "code.foss.global",
|
||||||
"gitscope": "push.rocks",
|
"gitscope": "push.rocks",
|
||||||
"gitrepo": "smartbucket",
|
"gitrepo": "smartbucket",
|
||||||
"description": "A TypeScript library for cloud-independent object storage, providing features like bucket creation, file and directory management, and data streaming.",
|
"description": "A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.",
|
||||||
"npmPackagename": "@push.rocks/smartbucket",
|
"npmPackagename": "@push.rocks/smartbucket",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"TypeScript",
|
||||||
"cloud storage",
|
"cloud storage",
|
||||||
"object storage",
|
"object storage",
|
||||||
"TypeScript",
|
"bucket creation",
|
||||||
"S3",
|
|
||||||
"minio",
|
|
||||||
"file management",
|
"file management",
|
||||||
"directory management",
|
"directory management",
|
||||||
"bucket creation",
|
|
||||||
"data streaming",
|
"data streaming",
|
||||||
"multi-cloud",
|
"multi-cloud",
|
||||||
"API",
|
"API",
|
||||||
"unified storage",
|
"unified storage",
|
||||||
|
"S3",
|
||||||
|
"minio",
|
||||||
|
"file locking",
|
||||||
|
"metadata",
|
||||||
"buffer handling",
|
"buffer handling",
|
||||||
"access key",
|
"access key",
|
||||||
"secret key",
|
"secret key",
|
||||||
"metadata",
|
|
||||||
"file locking",
|
|
||||||
"file streaming",
|
|
||||||
"directory listing",
|
|
||||||
"cloud agnostic"
|
"cloud agnostic"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
18
package.json
18
package.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartbucket",
|
"name": "@push.rocks/smartbucket",
|
||||||
"version": "3.0.8",
|
"version": "3.0.8",
|
||||||
"description": "A TypeScript library for cloud-independent object storage, providing features like bucket creation, file and directory management, and data streaming.",
|
"description": "A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist_ts/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@ -44,25 +44,23 @@
|
|||||||
"last 1 chrome versions"
|
"last 1 chrome versions"
|
||||||
],
|
],
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"TypeScript",
|
||||||
"cloud storage",
|
"cloud storage",
|
||||||
"object storage",
|
"object storage",
|
||||||
"TypeScript",
|
"bucket creation",
|
||||||
"S3",
|
|
||||||
"minio",
|
|
||||||
"file management",
|
"file management",
|
||||||
"directory management",
|
"directory management",
|
||||||
"bucket creation",
|
|
||||||
"data streaming",
|
"data streaming",
|
||||||
"multi-cloud",
|
"multi-cloud",
|
||||||
"API",
|
"API",
|
||||||
"unified storage",
|
"unified storage",
|
||||||
|
"S3",
|
||||||
|
"minio",
|
||||||
|
"file locking",
|
||||||
|
"metadata",
|
||||||
"buffer handling",
|
"buffer handling",
|
||||||
"access key",
|
"access key",
|
||||||
"secret key",
|
"secret key",
|
||||||
"metadata",
|
|
||||||
"file locking",
|
|
||||||
"file streaming",
|
|
||||||
"directory listing",
|
|
||||||
"cloud agnostic"
|
"cloud agnostic"
|
||||||
]
|
]
|
||||||
}
|
}
|
20
readme.md
20
readme.md
@ -1,10 +1,10 @@
|
|||||||
# @push.rocks/smartbucket
|
# @push.rocks/smartbucket
|
||||||
|
|
||||||
A TypeScript library that offers simple, cloud-independent object storage with features like bucket creation, file management, and directory management.
|
A TypeScript library for cloud-independent object storage, providing features like bucket creation, file and directory management, and data streaming.
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
To install `@push.rocks/smartbucket`, you need to have Node.js and npm (Node Package Manager) installed on your system. If you have them installed, you can add `@push.rocks/smartbucket` to your project by running the following command in your project's root directory:
|
To install `@push.rocks/smartbucket`, you need to have Node.js and npm (Node Package Manager) installed. If they are installed, you can add `@push.rocks/smartbucket` to your project by running the following command in your project's root directory:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install @push.rocks/smartbucket --save
|
npm install @push.rocks/smartbucket --save
|
||||||
@ -14,7 +14,7 @@ This command will download and install `@push.rocks/smartbucket` along with its
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
`@push.rocks/smartbucket` is a TypeScript module designed to provide simple cloud-independent object storage functionality. It wraps various cloud storage providers such as AWS S3, Google Cloud Storage, and others, offering a unified API to manage storage buckets and objects within those buckets.
|
`@push.rocks/smartbucket` is a TypeScript module designed to provide simple cloud-independent object storage functionality. It wraps various cloud storage providers such as AWS S3, Google Cloud Storage, and others, offering a unified API to manage storage buckets and objects within those buckets.
|
||||||
|
|
||||||
In this guide, we will delve into the usage of SmartBucket, covering its full range of features from setting up the library to advanced usage scenarios.
|
In this guide, we will delve into the usage of SmartBucket, covering its full range of features from setting up the library to advanced usage scenarios.
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ const mySmartBucket = new SmartBucket({
|
|||||||
accessKey: "yourAccessKey",
|
accessKey: "yourAccessKey",
|
||||||
accessSecret: "yourSecretKey",
|
accessSecret: "yourSecretKey",
|
||||||
endpoint: "yourEndpointURL",
|
endpoint: "yourEndpointURL",
|
||||||
port: 443, // Default is 443, could be customized for specific endpoint
|
port: 443, // Default is 443, can be customized for specific endpoint
|
||||||
useSsl: true // Defaults to true
|
useSsl: true // Defaults to true
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -190,7 +190,7 @@ async function writeFileStream(bucketName: string, filePath: string, readableStr
|
|||||||
// Create a readable stream from a string
|
// Create a readable stream from a string
|
||||||
const readable = new Readable();
|
const readable = new Readable();
|
||||||
readable.push('Hello world streamed as a file!');
|
readable.push('Hello world streamed as a file!');
|
||||||
readable.push(null); // Indicates end of the stream
|
readable.push(null); // End of stream
|
||||||
|
|
||||||
// Use the function
|
// Use the function
|
||||||
writeFileStream("exampleBucket", "path/to/streamedObject.txt", readable);
|
writeFileStream("exampleBucket", "path/to/streamedObject.txt", readable);
|
||||||
@ -198,9 +198,9 @@ writeFileStream("exampleBucket", "path/to/streamedObject.txt", readable);
|
|||||||
|
|
||||||
### Working with Directories
|
### Working with Directories
|
||||||
|
|
||||||
`@push.rocks/smartbucket` abstracts directories within buckets for easier object management. You can create, list, and delete directories using the `Directory` class.
|
`@push.rocks/smartbucket` offers abstractions for directories within buckets for easier object management. You can create, list, and delete directories using the `Directory` class.
|
||||||
|
|
||||||
Here's how to list the contents of a directory:
|
To list the contents of a directory:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
async function listDirectoryContents(bucketName: string, directoryPath: string) {
|
async function listDirectoryContents(bucketName: string, directoryPath: string) {
|
||||||
@ -254,11 +254,11 @@ createFileInDirectory("exampleBucket", "some/directory", "newfile.txt", "Hello,
|
|||||||
|
|
||||||
#### Bucket Policies
|
#### Bucket Policies
|
||||||
|
|
||||||
Manage bucket policies to control access permissions. This feature is dependent on the policies provided by the storage service (e.g., AWS S3, MinIO).
|
Manage bucket policies to control access permissions. This feature depends on the policies provided by the storage service (e.g., AWS S3, MinIO).
|
||||||
|
|
||||||
#### Object Metadata
|
#### Object Metadata
|
||||||
|
|
||||||
You can retrieve and modify object metadata. Metadata can be useful for storing additional information about an object.
|
Retrieve and modify object metadata. Metadata can be useful for storing additional information about an object.
|
||||||
|
|
||||||
To retrieve metadata:
|
To retrieve metadata:
|
||||||
|
|
||||||
@ -308,8 +308,6 @@ Remember, each cloud provider has specific features and limitations. `@push.rock
|
|||||||
|
|
||||||
This guide covers the basic to advanced scenarios of using `@push.rocks/smartbucket`. For further details, refer to the API documentation and examples.
|
This guide covers the basic to advanced scenarios of using `@push.rocks/smartbucket`. For further details, refer to the API documentation and examples.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## License and Legal Information
|
## License and Legal Information
|
||||||
|
|
||||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartbucket',
|
name: '@push.rocks/smartbucket',
|
||||||
version: '3.0.8',
|
version: '3.0.9',
|
||||||
description: 'A TypeScript library for cloud-independent object storage, providing features like bucket creation, file and directory management, and data streaming.'
|
description: 'A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user