Parallel Uploads From Gcs With Node.js Client Libraries

Google Cloud Platform logo

Google Cloud Storage: Node.js Client

release level npm version

Node.js idiomatic client for Deject Storage.

Deject Storage allows world-wide storage and retrieval of any amount of data at any time. Y'all can utilise Google Deject Storage for a range of scenarios including serving website content, storing information for archival and disaster recovery, or distributing large data objects to users via direct download.

A comprehensive listing of changes in each version may be plant in the CHANGELOG.

  • Google Deject Storage Node.js Client API Reference
  • Google Cloud Storage Documentation
  • github.com/googleapis/nodejs-storage

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Customer Libraries Explained.

Table of contents:

  • Quickstart
    • Before you begin
    • Installing the client library
    • Using the client library
  • Samples
  • Versioning
  • Contributing
  • License

Quickstart

Earlier you begin

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Google Deject Storage API.
  4. Set up authentication with a service business relationship and so you can access the API from your local workstation.

Installing the client library

npm install @google-cloud/storage

Using the client library

                // Imports the Google Deject customer library                const                {Storage}                =                crave                (                '@google-cloud/storage'                )                ;                // For more information on ways to initialize Storage, please see                // https://googleapis.dev/nodejs/storage/latest/Storage.html                // Creates a customer using Awarding Default Credentials                const                storage                =                new                Storage                (                )                ;                // Creates a client from a Google service account central                // const storage = new Storage({keyFilename: 'fundamental.json'});                /**                                  * TODO(developer): Uncomment these variables earlier running the sample.                                  */                // The ID of your GCS bucket                // const bucketName = 'your-unique-saucepan-name';                async                function                createBucket                (                )                {                // Creates the new bucket                expect                storage                .                createBucket                (                bucketName                )                ;                console                .                log                (                `Bucket                                      ${                    bucketName                    }                                    created.`                )                ;                }                createBucket                (                )                .                catch                (                panel                .                error                )                ;              

Samples

Samples are in the samples/ directory. Each sample'south README.dr. has instructions for running its sample.

Sample Source Code Try it
Add Bucket Provisional Binding source code Open in Cloud Shell
Add Bucket Default Possessor Acl source code Open in Cloud Shell
Add Bucket Iam Fellow member source code Open in Cloud Shell
Storage Add together Bucket Label. source code Open in Cloud Shell
Add Bucket Owner Acl source code Open in Cloud Shell
Saucepan Website Configuration. source code Open in Cloud Shell
Add File Possessor Acl source code Open in Cloud Shell
Storage Become Bucket Metadata. source code Open in Cloud Shell
Alter Saucepan's Default Storage Class. source code Open in Cloud Shell
Storage File Catechumen CSEK to CMEK. source code Open in Cloud Shell
Storage Combine files. source code Open in Cloud Shell
Storage Configure Bucket Cors. source code Open in Cloud Shell
Configure Retries source lawmaking Open in Cloud Shell
Copy File source code Open in Cloud Shell
Copy Old Version Of File. source code Open in Cloud Shell
Create a Dual-Region Bucket source code Open in Cloud Shell
Create Bucket With Storage Class and Location. source lawmaking Open in Cloud Shell
Create Bucket With Turbo Replication source code Open in Cloud Shell
Create New Bucket source code Open in Cloud Shell
Create Notification source code Open in Cloud Shell
Delete Saucepan source code Open in Cloud Shell
Delete File source code Open in Cloud Shell
Delete Notification source code Open in Cloud Shell
Delete Sometime Version Of File. source code Open in Cloud Shell
Disable Bucket Lifecycle Management source code Open in Cloud Shell
Storage Disable Bucket Versioning. source code Open in Cloud Shell
Disable Default Event Based Hold source code Open in Cloud Shell
Disable Requester Pays source lawmaking Open in Cloud Shell
Disable Uniform Bucket Level Access source code Open in Cloud Shell
Download Byte Range source lawmaking Open in Cloud Shell
Download Encrypted File source code Open in Cloud Shell
Download File source code Open in Cloud Shell
Download File Using Requester Pays source code Open in Cloud Shell
Download Into Memory source code Open in Cloud Shell
Storage Download Public File. source code Open in Cloud Shell
Enable Bucket Lifecycle Direction source code Open in Cloud Shell
Storage Enable Saucepan Versioning. source lawmaking Open in Cloud Shell
Enable Default Consequence Based Hold source code Open in Cloud Shell
Enable Default KMS Fundamental source code Open in Cloud Shell
Enable Requester Pays source code Open in Cloud Shell
Enable Uniform Bucket Level Access source lawmaking Open in Cloud Shell
Change File'south Storage Class. source code Open in Cloud Shell
Storage Set File Metadata. source lawmaking Open in Cloud Shell
Generate Encryption Key source code Open in Cloud Shell
Generate Signed Url source code Open in Cloud Shell
Generate V4 Read Signed Url source code Open in Cloud Shell
Generate V4 Signed Policy source code Open in Cloud Shell
Generate V4 Upload Signed Url source code Open in Cloud Shell
Become Default Event Based Concord source code Open in Cloud Shell
Get Metadata source code Open in Cloud Shell
Get Metadata Notifications source lawmaking Open in Cloud Shell
Become Public Access Prevention source code Open in Cloud Shell
Get RPO source code Open in Cloud Shell
Get Requester Pays Condition source code Open in Cloud Shell
Get Retention Policy source code Open in Cloud Shell
Storage Get Service Business relationship. source code Open in Cloud Shell
Go Compatible Bucket Level Access source code Open in Cloud Shell
Actuate HMAC SA Key. source lawmaking Open in Cloud Shell
Create HMAC SA Central. source code Open in Cloud Shell
Conciliate HMAC SA Primal. source code Open in Cloud Shell
Delete HMAC SA Fundamental. source code Open in Cloud Shell
Go HMAC SA Fundamental Metadata. source code Open in Cloud Shell
List HMAC SA Keys Metadata. source lawmaking Open in Cloud Shell
Listing Buckets source lawmaking Open in Cloud Shell
Listing Files source lawmaking Open in Cloud Shell
List Files By Prefix source code Open in Cloud Shell
List Files Paginate source code Open in Cloud Shell
List Files with Erstwhile Versions. source code Open in Cloud Shell
List Notifications source code Open in Cloud Shell
Lock Retention Policy source code Open in Cloud Shell
Storage Make Bucket Public. source code Open in Cloud Shell
Make Public source code Open in Cloud Shell
Move File source code Open in Cloud Shell
Impress Bucket Acl source code Open in Cloud Shell
Print Bucket Acl For User source code Open in Cloud Shell
Print File Acl source code Open in Cloud Shell
Print File Acl For User source lawmaking Open in Cloud Shell
Quickstart source code Open in Cloud Shell
Release Issue Based Hold source lawmaking Open in Cloud Shell
Release Temporary Hold source code Open in Cloud Shell
Remove Bucket Conditional Binding source code Open in Cloud Shell
Storage Remove Bucket Cors Configuration. source code Open in Cloud Shell
Remove Bucket Default Owner source lawmaking Open in Cloud Shell
Remove Bucket Iam Member source code Open in Cloud Shell
Storage Remove Bucket Label. source code Open in Cloud Shell
Remove Saucepan Possessor Acl source code Open in Cloud Shell
Remove Default KMS Central. source code Open in Cloud Shell
Remove File Owner Acl source code Open in Cloud Shell
Remove Retention Policy source code Open in Cloud Shell
Rename File source code Open in Cloud Shell
Rotate Encryption Cardinal source lawmaking Open in Cloud Shell
Gear up Client Endpoint source code Open in Cloud Shell
Set Result Based Hold source lawmaking Open in Cloud Shell
Fix Public Admission Prevention Enforced source code Open in Cloud Shell
Set Public Access Prevention Inherited source lawmaking Open in Cloud Shell
Ready RPO Async Turbo source code Open in Cloud Shell
Set up RPO Default source code Open in Cloud Shell
Set Retention Policy source lawmaking Open in Cloud Shell
Prepare Temporary Concur source lawmaking Open in Cloud Shell
Stream File Download source code Open in Cloud Shell
Stream File Upload source code Open in Cloud Shell
Upload a directory to a bucket. source code Open in Cloud Shell
Upload Encrypted File source code Open in Cloud Shell
Upload File source code Open in Cloud Shell
Upload File With Kms Fundamental source code Open in Cloud Shell
Upload From Retentivity source code Open in Cloud Shell
Upload Without Hallmark source code Open in Cloud Shell
Upload Without Hallmark Signed Url source code Open in Cloud Shell
View Bucket Iam Members source code Open in Cloud Shell

The Google Cloud Storage Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our customer libraries follow the Node.js release schedule. Libraries are uniform with all electric current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as before long as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a all-time-efforts basis with the post-obit warnings:

  • Legacy versions are non tested in continuous integration.
  • Some security patches and features cannot exist backported.
  • Dependencies cannot be kept upwards-to-engagement.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-deject/storage@legacy-8 installs client libraries for versions uniform with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be stable. The lawmaking surface will non alter in backwards-incompatible ways unless absolutely necessary (e.grand. because of critical security bug) or with an extensive deprecation period. Issues and requests confronting stable libraries are addressed with the highest priority.

More Information: Google Deject Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.doc, the samples/README.md, and a multifariousness of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, brand an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE

lutherfrouren.blogspot.com

Source: https://www.npmjs.com/package/@google-cloud/storage

0 Response to "Parallel Uploads From Gcs With Node.js Client Libraries"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel