1 | [//]: # "This README.md file is auto-generated, all changes to this file will be lost."
|
2 | [//]: # "To regenerate it, use `python -m synthtool`."
|
3 | <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
|
4 |
|
5 | # [Google Cloud Storage: Node.js Client](https://github.com/googleapis/nodejs-storage)
|
6 |
|
7 | [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
|
8 | [![npm version](https://img.shields.io/npm/v/@google-cloud/storage.svg)](https://www.npmjs.org/package/@google-cloud/storage)
|
9 | [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-storage/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-storage)
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | > Node.js idiomatic client for [Cloud Storage][product-docs].
|
15 |
|
16 | [Cloud Storage](https://cloud.google.com/storage/docs) allows world-wide
|
17 | storage and retrieval of any amount of data at any time. You can use Google
|
18 | Cloud Storage for a range of scenarios including serving website content,
|
19 | storing data for archival and disaster recovery, or distributing large data
|
20 | objects to users via direct download.
|
21 |
|
22 |
|
23 | A comprehensive list of changes in each version may be found in
|
24 | [the CHANGELOG](https://github.com/googleapis/nodejs-storage/blob/master/CHANGELOG.md).
|
25 |
|
26 | * [Google Cloud Storage Node.js Client API Reference][client-docs]
|
27 | * [Google Cloud Storage Documentation][product-docs]
|
28 | * [github.com/googleapis/nodejs-storage](https://github.com/googleapis/nodejs-storage)
|
29 |
|
30 | Read more about the client libraries for Cloud APIs, including the older
|
31 | Google APIs Client Libraries, in [Client Libraries Explained][explained].
|
32 |
|
33 | [explained]: https://cloud.google.com/apis/docs/client-libraries-explained
|
34 |
|
35 | **Table of contents:**
|
36 |
|
37 |
|
38 | * [Quickstart](#quickstart)
|
39 | * [Before you begin](#before-you-begin)
|
40 | * [Installing the client library](#installing-the-client-library)
|
41 | * [Using the client library](#using-the-client-library)
|
42 | * [Samples](#samples)
|
43 | * [Versioning](#versioning)
|
44 | * [Contributing](#contributing)
|
45 | * [License](#license)
|
46 |
|
47 | ## Quickstart
|
48 |
|
49 | ### Before you begin
|
50 |
|
51 | 1. [Select or create a Cloud Platform project][projects].
|
52 | 1. [Enable billing for your project][billing].
|
53 | 1. [Enable the Google Cloud Storage API][enable_api].
|
54 | 1. [Set up authentication with a service account][auth] so you can access the
|
55 | API from your local workstation.
|
56 |
|
57 | ### Installing the client library
|
58 |
|
59 | ```bash
|
60 | npm install @google-cloud/storage
|
61 | ```
|
62 |
|
63 |
|
64 | ### Using the client library
|
65 |
|
66 | ```javascript
|
67 | // Imports the Google Cloud client library
|
68 | const {Storage} = require('@google-cloud/storage');
|
69 |
|
70 | // For more information on ways to initialize Storage, please see
|
71 | // https://googleapis.dev/nodejs/storage/latest/Storage.html
|
72 |
|
73 | // Creates a client using Application Default Credentials
|
74 | const storage = new Storage();
|
75 |
|
76 | // Creates a client from a Google service account key
|
77 | // const storage = new Storage({keyFilename: 'key.json'});
|
78 |
|
79 | /**
|
80 | * TODO(developer): Uncomment these variables before running the sample.
|
81 | */
|
82 | // The ID of your GCS bucket
|
83 | // const bucketName = 'your-unique-bucket-name';
|
84 |
|
85 | async function createBucket() {
|
86 | // Creates the new bucket
|
87 | await storage.createBucket(bucketName);
|
88 | console.log(`Bucket ${bucketName} created.`);
|
89 | }
|
90 |
|
91 | createBucket().catch(console.error);
|
92 |
|
93 | ```
|
94 |
|
95 |
|
96 |
|
97 | ## Samples
|
98 |
|
99 | Samples are in the [`samples/`](https://github.com/googleapis/nodejs-storage/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample.
|
100 |
|
101 | | Sample | Source Code | Try it |
|
102 | | --------------------------- | --------------------------------- | ------ |
|
103 | | Add Bucket Conditional Binding | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addBucketConditionalBinding.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketConditionalBinding.js,samples/README.md) |
|
104 | | Add Bucket Default Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addBucketDefaultOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketDefaultOwnerAcl.js,samples/README.md) |
|
105 | | Add Bucket Iam Member | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addBucketIamMember.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketIamMember.js,samples/README.md) |
|
106 | | Storage Add Bucket Label. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addBucketLabel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketLabel.js,samples/README.md) |
|
107 | | Add Bucket Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addBucketOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketOwnerAcl.js,samples/README.md) |
|
108 | | Bucket Website Configuration. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addBucketWebsiteConfiguration.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addBucketWebsiteConfiguration.js,samples/README.md) |
|
109 | | Add File Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/addFileOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/addFileOwnerAcl.js,samples/README.md) |
|
110 | | Storage Get Bucket Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/bucketMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/bucketMetadata.js,samples/README.md) |
|
111 | | Change Bucket's Default Storage Class. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/changeDefaultStorageClass.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/changeDefaultStorageClass.js,samples/README.md) |
|
112 | | Storage File Convert CSEK to CMEK. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/changeFileCSEKToCMEK.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/changeFileCSEKToCMEK.js,samples/README.md) |
|
113 | | Storage Combine files. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/composeFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/composeFile.js,samples/README.md) |
|
114 | | Storage Configure Bucket Cors. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/configureBucketCors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/configureBucketCors.js,samples/README.md) |
|
115 | | Copy File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/copyFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/copyFile.js,samples/README.md) |
|
116 | | Copy Old Version Of File. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/copyOldVersionOfFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/copyOldVersionOfFile.js,samples/README.md) |
|
117 | | Create Bucket With Storage Class and Location. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/createBucketWithStorageClassAndLocation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createBucketWithStorageClassAndLocation.js,samples/README.md) |
|
118 | | Create New Bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/createNewBucket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createNewBucket.js,samples/README.md) |
|
119 | | Create Notification | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/createNotification.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/createNotification.js,samples/README.md) |
|
120 | | Delete Bucket | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/deleteBucket.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteBucket.js,samples/README.md) |
|
121 | | Delete File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/deleteFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteFile.js,samples/README.md) |
|
122 | | Delete Notification | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/deleteNotification.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteNotification.js,samples/README.md) |
|
123 | | Delete Old Version Of File. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/deleteOldVersionOfFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/deleteOldVersionOfFile.js,samples/README.md) |
|
124 | | Disable Bucket Lifecycle Management | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/disableBucketLifecycleManagement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableBucketLifecycleManagement.js,samples/README.md) |
|
125 | | Storage Disable Bucket Versioning. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/disableBucketVersioning.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableBucketVersioning.js,samples/README.md) |
|
126 | | Disable Default Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/disableDefaultEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableDefaultEventBasedHold.js,samples/README.md) |
|
127 | | Disable Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/disableRequesterPays.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableRequesterPays.js,samples/README.md) |
|
128 | | Disable Uniform Bucket Level Access | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/disableUniformBucketLevelAccess.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/disableUniformBucketLevelAccess.js,samples/README.md) |
|
129 | | Download Encrypted File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/downloadEncryptedFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadEncryptedFile.js,samples/README.md) |
|
130 | | Download File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/downloadFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadFile.js,samples/README.md) |
|
131 | | Download File Using Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/downloadFileUsingRequesterPays.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadFileUsingRequesterPays.js,samples/README.md) |
|
132 | | Storage Download Public File. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/downloadPublicFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/downloadPublicFile.js,samples/README.md) |
|
133 | | Enable Bucket Lifecycle Management | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/enableBucketLifecycleManagement.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableBucketLifecycleManagement.js,samples/README.md) |
|
134 | | Storage Enable Bucket Versioning. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/enableBucketVersioning.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableBucketVersioning.js,samples/README.md) |
|
135 | | Enable Default Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/enableDefaultEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableDefaultEventBasedHold.js,samples/README.md) |
|
136 | | Enable Default KMS Key | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/enableDefaultKMSKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableDefaultKMSKey.js,samples/README.md) |
|
137 | | Enable Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/enableRequesterPays.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableRequesterPays.js,samples/README.md) |
|
138 | | Enable Uniform Bucket Level Access | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/enableUniformBucketLevelAccess.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/enableUniformBucketLevelAccess.js,samples/README.md) |
|
139 | | Change File's Storage Class. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/fileChangeStorageClass.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/fileChangeStorageClass.js,samples/README.md) |
|
140 | | Storage Set File Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/fileSetMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/fileSetMetadata.js,samples/README.md) |
|
141 | | Generate Encryption Key | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/generateEncryptionKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateEncryptionKey.js,samples/README.md) |
|
142 | | Generate Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/generateSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateSignedUrl.js,samples/README.md) |
|
143 | | Generate V4 Read Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/generateV4ReadSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateV4ReadSignedUrl.js,samples/README.md) |
|
144 | | Generate V4 Signed Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/generateV4SignedPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateV4SignedPolicy.js,samples/README.md) |
|
145 | | Generate V4 Upload Signed Url | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/generateV4UploadSignedUrl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/generateV4UploadSignedUrl.js,samples/README.md) |
|
146 | | Get Default Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getDefaultEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getDefaultEventBasedHold.js,samples/README.md) |
|
147 | | Get Metadata | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getMetadata.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getMetadata.js,samples/README.md) |
|
148 | | Get Metadata Notifications | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getMetadataNotifications.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getMetadataNotifications.js,samples/README.md) |
|
149 | | Get Public Access Prevention | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getPublicAccessPrevention.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getPublicAccessPrevention.js,samples/README.md) |
|
150 | | Get Requester Pays Status | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getRequesterPaysStatus.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getRequesterPaysStatus.js,samples/README.md) |
|
151 | | Get Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getRetentionPolicy.js,samples/README.md) |
|
152 | | Storage Get Service Account. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getServiceAccount.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getServiceAccount.js,samples/README.md) |
|
153 | | Get Uniform Bucket Level Access | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/getUniformBucketLevelAccess.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/getUniformBucketLevelAccess.js,samples/README.md) |
|
154 | | Activate HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/hmacKeyActivate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyActivate.js,samples/README.md) |
|
155 | | Create HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/hmacKeyCreate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyCreate.js,samples/README.md) |
|
156 | | Deactivate HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/hmacKeyDeactivate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyDeactivate.js,samples/README.md) |
|
157 | | Delete HMAC SA Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/hmacKeyDelete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyDelete.js,samples/README.md) |
|
158 | | Get HMAC SA Key Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/hmacKeyGet.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeyGet.js,samples/README.md) |
|
159 | | List HMAC SA Keys Metadata. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/hmacKeysList.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/hmacKeysList.js,samples/README.md) |
|
160 | | List Buckets | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/listBuckets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listBuckets.js,samples/README.md) |
|
161 | | List Files | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/listFiles.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFiles.js,samples/README.md) |
|
162 | | List Files By Prefix | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/listFilesByPrefix.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFilesByPrefix.js,samples/README.md) |
|
163 | | List Files Paginate | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/listFilesPaginate.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFilesPaginate.js,samples/README.md) |
|
164 | | List Files with Old Versions. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/listFilesWithOldVersions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listFilesWithOldVersions.js,samples/README.md) |
|
165 | | List Notifications | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/listNotifications.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/listNotifications.js,samples/README.md) |
|
166 | | Lock Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/lockRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/lockRetentionPolicy.js,samples/README.md) |
|
167 | | Storage Make Bucket Public. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/makeBucketPublic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/makeBucketPublic.js,samples/README.md) |
|
168 | | Make Public | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/makePublic.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/makePublic.js,samples/README.md) |
|
169 | | Move File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/moveFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/moveFile.js,samples/README.md) |
|
170 | | Print Bucket Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/printBucketAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printBucketAcl.js,samples/README.md) |
|
171 | | Print Bucket Acl For User | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/printBucketAclForUser.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printBucketAclForUser.js,samples/README.md) |
|
172 | | Print File Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/printFileAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printFileAcl.js,samples/README.md) |
|
173 | | Print File Acl For User | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/printFileAclForUser.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/printFileAclForUser.js,samples/README.md) |
|
174 | | Quickstart | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
|
175 | | Release Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/releaseEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/releaseEventBasedHold.js,samples/README.md) |
|
176 | | Release Temporary Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/releaseTemporaryHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/releaseTemporaryHold.js,samples/README.md) |
|
177 | | Remove Bucket Conditional Binding | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeBucketConditionalBinding.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketConditionalBinding.js,samples/README.md) |
|
178 | | Storage Remove Bucket Cors Configuration. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeBucketCors.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketCors.js,samples/README.md) |
|
179 | | Remove Bucket Default Owner | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeBucketDefaultOwner.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketDefaultOwner.js,samples/README.md) |
|
180 | | Remove Bucket Iam Member | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeBucketIamMember.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketIamMember.js,samples/README.md) |
|
181 | | Storage Remove Bucket Label. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeBucketLabel.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketLabel.js,samples/README.md) |
|
182 | | Remove Bucket Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeBucketOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeBucketOwnerAcl.js,samples/README.md) |
|
183 | | Remove Default KMS Key. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeDefaultKMSKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeDefaultKMSKey.js,samples/README.md) |
|
184 | | Remove File Owner Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeFileOwnerAcl.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeFileOwnerAcl.js,samples/README.md) |
|
185 | | Remove Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/removeRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/removeRetentionPolicy.js,samples/README.md) |
|
186 | | Rename File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/renameFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/renameFile.js,samples/README.md) |
|
187 | | Rotate Encryption Key | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/rotateEncryptionKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/rotateEncryptionKey.js,samples/README.md) |
|
188 | | Set Event Based Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/setEventBasedHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setEventBasedHold.js,samples/README.md) |
|
189 | | Set Public Access Prevention Enforced | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/setPublicAccessPreventionEnforced.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setPublicAccessPreventionEnforced.js,samples/README.md) |
|
190 | | Set Public Access Prevention Unspecified | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/setPublicAccessPreventionUnspecified.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setPublicAccessPreventionUnspecified.js,samples/README.md) |
|
191 | | Set Retention Policy | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/setRetentionPolicy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setRetentionPolicy.js,samples/README.md) |
|
192 | | Set Temporary Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/setTemporaryHold.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/setTemporaryHold.js,samples/README.md) |
|
193 | | Upload a directory to a bucket. | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/uploadDirectory.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadDirectory.js,samples/README.md) |
|
194 | | Upload Encrypted File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/uploadEncryptedFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadEncryptedFile.js,samples/README.md) |
|
195 | | Upload File | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/uploadFile.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadFile.js,samples/README.md) |
|
196 | | Upload File With Kms Key | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/uploadFileWithKmsKey.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/uploadFileWithKmsKey.js,samples/README.md) |
|
197 | | View Bucket Iam Members | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/viewBucketIamMembers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-storage&page=editor&open_in_editor=samples/viewBucketIamMembers.js,samples/README.md) |
|
198 |
|
199 |
|
200 |
|
201 | The [Google Cloud Storage Node.js Client API Reference][client-docs] documentation
|
202 | also contains samples.
|
203 |
|
204 | ## Supported Node.js Versions
|
205 |
|
206 | Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/).
|
207 | Libraries are compatible with all current _active_ and _maintenance_ versions of
|
208 | Node.js.
|
209 |
|
210 | Client libraries targeting some end-of-life versions of Node.js are available, and
|
211 | can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
|
212 | The dist-tags follow the naming convention `legacy-(version)`.
|
213 |
|
214 | _Legacy Node.js versions are supported as a best effort:_
|
215 |
|
216 | * Legacy versions will not be tested in continuous integration.
|
217 | * Some security patches may not be able to be backported.
|
218 | * Dependencies will not be kept up-to-date, and features will not be backported.
|
219 |
|
220 | #### Legacy tags available
|
221 |
|
222 | * `legacy-8`: install client libraries from this dist-tag for versions
|
223 | compatible with Node.js 8.
|
224 |
|
225 | ## Versioning
|
226 |
|
227 | This library follows [Semantic Versioning](http://semver.org/).
|
228 |
|
229 |
|
230 | This library is considered to be **General Availability (GA)**. This means it
|
231 | is stable; the code surface will not change in backwards-incompatible ways
|
232 | unless absolutely necessary (e.g. because of critical security issues) or with
|
233 | an extensive deprecation period. Issues and requests against **GA** libraries
|
234 | are addressed with the highest priority.
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 | More Information: [Google Cloud Platform Launch Stages][launch_stages]
|
241 |
|
242 | [launch_stages]: https://cloud.google.com/terms/launch-stages
|
243 |
|
244 | ## Contributing
|
245 |
|
246 | Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-storage/blob/master/CONTRIBUTING.md).
|
247 |
|
248 | Please note that this `README.md`, the `samples/README.md`,
|
249 | and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
|
250 | are generated from a central template. To edit one of these files, make an edit
|
251 | to its template in this
|
252 | [directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library).
|
253 |
|
254 | ## License
|
255 |
|
256 | Apache Version 2.0
|
257 |
|
258 | See [LICENSE](https://github.com/googleapis/nodejs-storage/blob/master/LICENSE)
|
259 |
|
260 | [client-docs]: https://googleapis.dev/nodejs/storage/latest
|
261 | [product-docs]: https://cloud.google.com/storage
|
262 | [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
|
263 | [projects]: https://console.cloud.google.com/project
|
264 | [billing]: https://support.google.com/cloud/answer/6293499#enable-billing
|
265 | [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com
|
266 | [auth]: https://cloud.google.com/docs/authentication/getting-started
|