Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cloudflare-r2-with-stream
Advanced tools
This is a wrapper of the AWS S3 client library, designed to provide a user-friendly and efficient way to interact with Cloudflare R2 API in Node.js
⚠ This library is currently in development and is not yet ready for production use. It is subject to change and may contain bugs or other issues. Please use it at your own risk.
npm install node-cloudflare-r2
It is highly recommended that you use a specific version number in your installation to anticipate any breaking changes that may occur in future releases. For example:
npm install node-cloudflare-r2@1.0.0
Check the latest version number in the release page.
import { R2 } from 'node-cloudflare-r2';
const r2 = new R2({
accountId: '<YOUR_ACCOUNT_ID>',
accessKeyId: '<YOUR_R2_ACCESS_KEY_ID>',
secretAccessKey: '<YOUR_R2_SECRET_ACCESS_KEY>',
});
const bucket = r2.bucket('<BUCKET_NAME>');
// Set your bucket's public URL
bucket.provideBucketPublicUrl('https://pub-xxxxxxxxxxxxxxxxxxxxxxxxx.r2.dev');
console.log(await bucket.exists());
// true
const upload = await bucket.uploadFile('/path/to/file', 'destination_file_name.ext');
console.log(upload);
/*
{
objectKey: 'destination_file_name.ext',
uri: 'destination_file_name.ext',
publicUrl: 'https://pub-xxxxxxxxxxxxxxxxxxxxxxxxx.r2.dev/destination_file_name.ext',
etag: '',
versionId: '',
}
*/
FAQs
S3 wrapper for Cloudflare R2.
We found that cloudflare-r2-with-stream 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.