@google-cloud/storage
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
@google-cloud/paginator | 5.0.0 | 13.13 kB | Apache-2.0 | prod | |
@google-cloud/projectify | 4.0.0 | 9.79 kB | Apache-2.0 | prod | |
@google-cloud/promisify | 4.0.0 | 10.69 kB | Apache-2.0 | prod | |
abort-controller | 3.0.0 | 17.14 kB | MIT | prod | |
async-retry | 1.3.3 | 2.53 kB | MIT | prod | |
compressible | 2.0.18 | 3 kB | MIT | prod | |
duplexify | 4.1.3 | 17.87 kB | MIT | prod | |
ent | 2.2.0 | 23.73 kB | MIT | prod | |
fast-xml-parser | 4.3.6 | 164.06 kB | MIT | prod | |
gaxios | 6.5.0 | 103.48 kB | Apache-2.0 | prod | |
google-auth-library | 9.9.0 | 575.74 kB | Apache-2.0 | prod | |
mime-types | 2.1.35 | 5.46 kB | MIT | prod | |
mime | 3.0.0 | 18.25 kB | MIT | prod | |
p-limit | 3.1.0 | 3.19 kB | MIT | prod | |
retry-request | 6.0.0 | 6.18 kB | MIT | prod | |
teeny-request | 9.0.0 | 17.97 kB | Apache-2.0 | prod | |
uuid | 8.3.2 | 27.32 kB | MIT | prod |
The "@google-cloud/storage" is a Node.js client for Google Cloud Storage. This package provides idiomatic interaction with Google's world-wide storage and retrieval service, which lets you store any amounts of data at any time. The API client can be used for a variety of tasks, such as serving website content, storing data for archival and disaster recovery, and distributing large data objects to users via direct download.
To use "@google-cloud/storage", you need to install the package in your project by running npm install @google-cloud/storage
from your terminal. Below is an example of how you might use "@google-cloud/storage" in a JavaScript file:
// Imports the Google Cloud client library
const {Storage} = require('@google-cloud/storage');
// Creates a client using Application Default Credentials
const storage = new Storage();
// The ID of your GCS bucket
const bucketName = 'your-unique-bucket-name';
async function createBucket() {
// Creates the new bucket
await storage.createBucket(bucketName);
console.log(`Bucket ${bucketName} created.`);
}
createBucket().catch(console.error);
In the above example, the Storage client is initialized and then used to create a new bucket in your Google Cloud Storage.
You can find the "@google-cloud/storage" documentation at the Google Cloud Storage Node.js Client API Reference and the Google Cloud Storage Documentation. They provide a comprehensive guide on how to use the Google Cloud Storage with Node.js, along with useful examples and practices.