
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@amaster.ai/s3-client
Advanced tools
Type-safe client for interacting with Amaster S3 storage service.
npm install @amaster.ai/s3-client
# or
pnpm add @amaster.ai/s3-client
import { createS3Client } from '@amaster.ai/s3-client';
const s3Client = createS3Client();
// 1. Upload a file
const fileInput = document.querySelector('input[type="file"]');
if (fileInput.files.length > 0) {
const file = fileInput.files[0];
const uploadResult = await s3Client.upload(file, {
category: 'avatars',
onProgress: ({ percentage }) => {
console.log(`Uploading: ${percentage}%`);
},
});
if (uploadResult.data) {
console.log('Uploaded:', uploadResult.data.url);
console.log('Key:', uploadResult.data.key);
}
}
// 2. Get file metadata
const metadata = await s3Client.getMetadata('uploads/image.png');
if (metadata.data) {
console.log('Type:', metadata.data.contentType);
console.log('Size:', metadata.data.contentLength);
}
// 3. Download a file
const downloadResult = await s3Client.download('uploads/image.png');
if (downloadResult.data) {
// result.data is a Blob
const url = URL.createObjectURL(downloadResult.data);
window.open(url);
}
createS3Client(http?: HttpClient)Creates a new instance of the S3 client. Optionally accepts a custom HTTP client.
upload(file: File | Blob, options?: S3UploadOptions)Uploads a file to the storage.
Large files automatically switch to multipart upload inside the SDK. The caller
still uses the same upload(file, options?) entrypoint. Browser multipart
uploads report aggregate progress across all parts.
file: File or Blob object to upload.options.fileName: optional filename override.options.category: optional storage category metadata.options.onProgress: optional callback receiving { loaded, total, percentage, phase }.Promise<ClientResult<UploadRes>>download(filename: string)Downloads a file as a Blob.
filename: The key/path of the file to download.Promise<ClientResult<Blob>>getMetadata(key: string)Retrieves metadata for a specific file.
key: The key/path of the file.Promise<ClientResult<S3Metadata>>FAQs
S3 storage client for file upload, download and management
We found that @amaster.ai/s3-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.