UNPKG

30.3 kBMarkdownView Raw
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
17storage and retrieval of any amount of data at any time. You can use Google
18Cloud Storage for a range of scenarios including serving website content,
19storing data for archival and disaster recovery, or distributing large data
20objects to users via direct download.
21
22
23* [Google Cloud Storage Node.js Client API Reference][client-docs]
24* [Google Cloud Storage Documentation][product-docs]
25* [github.com/googleapis/nodejs-storage](https://github.com/googleapis/nodejs-storage)
26
27Read more about the client libraries for Cloud APIs, including the older
28Google APIs Client Libraries, in [Client Libraries Explained][explained].
29
30[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
31
32**Table of contents:**
33
34
35* [Quickstart](#quickstart)
36 * [Before you begin](#before-you-begin)
37 * [Installing the client library](#installing-the-client-library)
38 * [Using the client library](#using-the-client-library)
39* [Samples](#samples)
40* [Versioning](#versioning)
41* [Contributing](#contributing)
42* [License](#license)
43
44## Quickstart
45
46### Before you begin
47
481. [Select or create a Cloud Platform project][projects].
491. [Enable billing for your project][billing].
501. [Enable the Google Cloud Storage API][enable_api].
511. [Set up authentication with a service account][auth] so you can access the
52 API from your local workstation.
53
54### Installing the client library
55
56```bash
57npm install @google-cloud/storage
58```
59
60
61### Using the client library
62
63```javascript
64// Imports the Google Cloud client library
65const {Storage} = require('@google-cloud/storage');
66
67// Creates a client
68const storage = new Storage();
69// Creates a client from a Google service account key.
70// const storage = new Storage({keyFilename: "key.json"});
71
72/**
73 * TODO(developer): Uncomment these variables before running the sample.
74 */
75// const bucketName = 'bucket-name';
76
77async function createBucket() {
78 // Creates the new bucket
79 await storage.createBucket(bucketName);
80 console.log(`Bucket ${bucketName} created.`);
81}
82
83createBucket().catch(console.error);
84
85```
86
87
88
89## Samples
90
91Samples are in the [`samples/`](https://github.com/googleapis/nodejs-storage/tree/master/samples) directory. The samples' `README.md`
92has instructions for running the samples.
93
94| Sample | Source Code | Try it |
95| --------------------------- | --------------------------------- | ------ |
96| 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) |
97| 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) |
98| 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) |
99| 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) |
100| 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) |
101| 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) |
102| 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) |
103| 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) |
104| 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) |
105| 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) |
106| 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) |
107| 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) |
108| 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) |
109| 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) |
110| 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) |
111| 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) |
112| 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) |
113| 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) |
114| 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) |
115| 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) |
116| 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) |
117| 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) |
118| 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) |
119| 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) |
120| 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) |
121| 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) |
122| 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) |
123| 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) |
124| 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) |
125| 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) |
126| 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) |
127| 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) |
128| 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) |
129| 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) |
130| 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) |
131| 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) |
132| 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) |
133| 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) |
134| 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) |
135| 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) |
136| 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) |
137| 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) |
138| 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) |
139| 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) |
140| 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) |
141| 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) |
142| 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) |
143| Notifications | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/notifications.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/notifications.js,samples/README.md) |
144| 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) |
145| 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) |
146| 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) |
147| 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) |
148| 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) |
149| 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) |
150| 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) |
151| 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) |
152| 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) |
153| 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) |
154| 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) |
155| 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) |
156| 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) |
157| 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) |
158| 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) |
159| 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) |
160| Set Temporaryd Hold | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/setTemporarydHold.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/setTemporarydHold.js,samples/README.md) |
161| 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) |
162| 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) |
163| 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) |
164| 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) |
165| 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) |
166
167
168
169The [Google Cloud Storage Node.js Client API Reference][client-docs] documentation
170also contains samples.
171
172## Supported Node.js Versions
173
174Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/).
175Libraries are compatible with all current _active_ and _maintenance_ versions of
176Node.js.
177
178Client libraries targetting some end-of-life versions of Node.js are available, and
179can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
180The dist-tags follow the naming convention `legacy-(version)`.
181
182_Legacy Node.js versions are supported as a best effort:_
183
184* Legacy versions will not be tested in continuous integration.
185* Some security patches may not be able to be backported.
186* Dependencies will not be kept up-to-date, and features will not be backported.
187
188#### Legacy tags available
189
190* `legacy-8`: install client libraries from this dist-tag for versions
191 compatible with Node.js 8.
192
193## Versioning
194
195This library follows [Semantic Versioning](http://semver.org/).
196
197
198This library is considered to be **General Availability (GA)**. This means it
199is stable; the code surface will not change in backwards-incompatible ways
200unless absolutely necessary (e.g. because of critical security issues) or with
201an extensive deprecation period. Issues and requests against **GA** libraries
202are addressed with the highest priority.
203
204
205
206
207
208More Information: [Google Cloud Platform Launch Stages][launch_stages]
209
210[launch_stages]: https://cloud.google.com/terms/launch-stages
211
212## Contributing
213
214Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-storage/blob/master/CONTRIBUTING.md).
215
216Please note that this `README.md`, the `samples/README.md`,
217and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`)
218are generated from a central template. To edit one of these files, make an edit
219to its template in this
220[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library).
221
222## License
223
224Apache Version 2.0
225
226See [LICENSE](https://github.com/googleapis/nodejs-storage/blob/master/LICENSE)
227
228[client-docs]: https://googleapis.dev/nodejs/storage/latest
229[product-docs]: https://cloud.google.com/storage
230[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
231[projects]: https://console.cloud.google.com/project
232[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
233[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com
234[auth]: https://cloud.google.com/docs/authentication/getting-started