Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@firebase/storage
Advanced tools
@firebase/storage is a Firebase service that provides a powerful, simple, and cost-effective object storage solution for web and mobile applications. It allows developers to upload, download, and manage files such as images, videos, and other user-generated content directly from their applications.
Upload Files
This feature allows you to upload files to Firebase Storage. The code sample demonstrates how to upload a simple text file to a specified storage reference.
const { getStorage, ref, uploadBytes } = require('@firebase/storage');
const storage = getStorage();
const storageRef = ref(storage, 'some-child');
const file = new Blob(['Hello, world!'], { type: 'text/plain' });
uploadBytes(storageRef, file).then((snapshot) => {
console.log('Uploaded a blob or file!');
});
Download Files
This feature allows you to download files from Firebase Storage. The code sample demonstrates how to get the download URL for a file stored in Firebase Storage.
const { getStorage, ref, getDownloadURL } = require('@firebase/storage');
const storage = getStorage();
const storageRef = ref(storage, 'some-child');
getDownloadURL(storageRef).then((url) => {
console.log('File available at', url);
});
Delete Files
This feature allows you to delete files from Firebase Storage. The code sample demonstrates how to delete a file from a specified storage reference.
const { getStorage, ref, deleteObject } = require('@firebase/storage');
const storage = getStorage();
const storageRef = ref(storage, 'some-child');
deleteObject(storageRef).then(() => {
console.log('File deleted successfully');
}).catch((error) => {
console.error('Error deleting file:', error);
});
List Files
This feature allows you to list all files within a specified directory in Firebase Storage. The code sample demonstrates how to list all files under a specific storage reference.
const { getStorage, ref, listAll } = require('@firebase/storage');
const storage = getStorage();
const listRef = ref(storage, 'some-child');
listAll(listRef).then((res) => {
res.items.forEach((itemRef) => {
console.log('Item:', itemRef.name);
});
}).catch((error) => {
console.error('Error listing files:', error);
});
The aws-sdk package provides comprehensive support for interacting with Amazon Web Services (AWS), including S3 for object storage. It offers similar functionalities to @firebase/storage, such as uploading, downloading, and managing files, but it is more complex and provides a broader range of services beyond storage.
The @google-cloud/storage package allows you to interact with Google Cloud Storage, offering similar functionalities to @firebase/storage. It provides methods for uploading, downloading, and managing files in Google Cloud Storage, but it is designed for use with Google Cloud Platform rather than Firebase.
The azure-storage package provides support for interacting with Microsoft Azure Storage services, including Blob storage. It offers similar functionalities to @firebase/storage, such as uploading, downloading, and managing files, but it is tailored for use with Microsoft Azure.
This is the Cloud Storage component of the Firebase JS SDK.
This package is not intended for direct usage, and should only be used via the officially supported firebase package.
FAQs
This is the Cloud Storage component of the Firebase JS SDK.
The npm package @firebase/storage receives a total of 1,834,660 weekly downloads. As such, @firebase/storage popularity was classified as popular.
We found that @firebase/storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.