Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

bucket-aws-sdk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bucket-aws-sdk

basic implementation of the local bucket

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

bucket-aws-sdk

Basic Implementation of the Local Bucket

Installation

To install the bucket-aws-sdk package, run the following command:

npm install bucket-aws-sdk

Usage

Here is an example of how to use the LocalBucket class:

const LocalBucket = require('bucket-aws-sdk');

// Create an instance of the LocalBucket
const bucket = new LocalBucket('username');

// Create an account
bucket.createAccount('password');

// Login to the account
bucket.login('password');

// Save a file
bucket.saveFile({ name: 'file.txt', contents: 'Hello, world!' });

// Get a list of files
const files = bucket.getFiles();
console.log(files);

// Get file statistics
const fileStats = bucket.getFilesStats();
console.log(fileStats);

// Logout from the account
bucket.logout();

API

LocalBucket

The LocalBucket class represents a local bucket for storing files.

Constructor

  • new LocalBucket(userName: string): Creates a new instance of the LocalBucket class with the specified userName. Methods
  • createAccount(password: string): boolean: Creates a new account with the provided password. Returns true on success.
  • login(password: string): boolean: Logs in to the account with the provided password. Returns true on successful authentication.
  • logout(): boolean: Logs out from the current account. Returns true on success.
  • saveFile(file: { name: string, contents: string }): boolean: Saves a file with the specified name and contents to the bucket. Returns true if the file was saved successfully.
  • getFiles(): string[]: Retrieves a list of files in the bucket. Returns an array of file names.
  • getFilesStats(): { name: string, size: number, created: Date, modified: Date }[]: Retrieves statistics for each file in the bucket. Returns an array of file statistics objects, including name, size, created (birth time), and modified (last modified time).

Issues

If you encounter any issues or have any questions, please create an issue on the GitHub repository.

Versioning

This project follows the principles of Semantic Versioning.

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the ISC License.

Keywords

local-bucket

FAQs

Package last updated on 27 May 2023

Did you know?

Socket

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.

Install

Related posts