Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit ca69a83

Browse files
[CHANGE ME] Re-generated to pick up changes in the API or client library generator.
1 parent b7e446c commit ca69a83

2 files changed

Lines changed: 57 additions & 70 deletions

File tree

README.md

Lines changed: 55 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,57 @@
11
[//]: # "This README.md file is auto-generated, all changes to this file will be lost."
2-
[//]: # "To regenerate it, use `npm run generate-scaffolding`."
2+
[//]: # "To regenerate it, use `python -m synthtool`."
33
<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"/>
44

55
# [Google Cloud Storage: Node.js Client](https://github.com/googleapis/nodejs-storage)
66

7-
[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
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)
88
[![npm version](https://img.shields.io/npm/v/@google-cloud/storage.svg)](https://www.npmjs.org/package/@google-cloud/storage)
99
[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-storage/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-storage)
1010

11-
> Node.js idiomatic client for [Cloud Storage][product-docs].
1211

13-
[Cloud Storage](https://cloud.google.com/storage/docs) allows world-wide storage and retrieval of any amount of data at any time. You can use Google Cloud Storage for a range of scenarios including serving website content, storing data for archival and disaster recovery, or distributing large data objects to users via direct download.
12+
Cloud Storage Client Library for Node.js
1413

1514

16-
* [Cloud Storage Node.js Client API Reference][client-docs]
17-
* [github.com/googleapis/nodejs-storage](https://github.com/googleapis/nodejs-storage)
18-
* [Cloud Storage Documentation][product-docs]
19-
20-
Read more about the client libraries for Cloud APIs, including the older
21-
Google APIs Client Libraries, in [Client Libraries Explained][explained].
22-
23-
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
24-
25-
**Table of contents:**
26-
27-
* [Quickstart](#quickstart)
28-
* [Before you begin](#before-you-begin)
29-
* [Installing the client library](#installing-the-client-library)
30-
* [Using the client library](#using-the-client-library)
15+
* [Using the client library](#using-the-client-library)
3116
* [Samples](#samples)
3217
* [Versioning](#versioning)
3318
* [Contributing](#contributing)
3419
* [License](#license)
3520

36-
## Quickstart
37-
38-
### Before you begin
39-
40-
1. Select or create a Cloud Platform project.
21+
## Using the client library
4122

42-
[Go to the projects page][projects]
23+
1. [Select or create a Cloud Platform project][projects].
24+
1. [Enable billing for your project][billing].
25+
1. [Enable the Google Cloud Storage API][enable_api].
26+
1. [Set up authentication with a service account][auth] so you can access the
27+
API from your local workstation.
4328

44-
1. Enable billing for your project.
29+
1. Install the client library:
4530

46-
[Enable billing][billing]
31+
npm install @google-cloud/storage
4732

48-
1. Enable the Google Cloud Storage API.
4933

50-
[Enable the API][enable_api]
34+
1. Try an example:
5135

52-
1. [Set up authentication with a service account][auth] so you can access the
53-
API from your local workstation.
36+
```javascript
37+
async function quickstart(
38+
projectId = 'YOUR_PROJECT_ID', // Your Google Cloud Platform project ID
39+
bucketName = 'my-new-bucket' // The name for the new bucket
40+
) {
41+
// Imports the Google Cloud client library
42+
const {Storage} = require('@google-cloud/storage');
5443

55-
[projects]: https://console.cloud.google.com/project
56-
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
57-
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com
58-
[auth]: https://cloud.google.com/docs/authentication/getting-started
44+
// Creates a client
45+
const storage = new Storage({projectId});
5946

60-
### Installing the client library
47+
// Creates the new bucket
48+
await storage.createBucket(bucketName);
49+
console.log(`Bucket ${bucketName} created.`);
50+
}
6151

62-
npm install --save @google-cloud/storage
52+
```
6353

64-
### Using the client library
6554

66-
```javascript
67-
// Imports the Google Cloud client library
68-
const {Storage} = require('@google-cloud/storage');
69-
70-
// Your Google Cloud Platform project ID
71-
const projectId = 'YOUR_PROJECT_ID';
72-
73-
// Creates a client
74-
const storage = new Storage({
75-
projectId: projectId,
76-
});
77-
78-
// The name for the new bucket
79-
const bucketName = 'my-new-bucket';
80-
81-
// Creates the new bucket
82-
storage
83-
.createBucket(bucketName)
84-
.then(() => {
85-
console.log(`Bucket ${bucketName} created.`);
86-
})
87-
.catch(err => {
88-
console.error('ERROR:', err);
89-
});
90-
```
9155

9256
## Samples
9357

@@ -96,26 +60,35 @@ has instructions for running the samples.
9660

9761
| Sample | Source Code | Try it |
9862
| --------------------------- | --------------------------------- | ------ |
99-
| ACL (Access Control Lists) | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/acl.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/acl.js,samples/README.md) |
63+
| Acl | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/acl.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/acl.js,samples/README.md) |
64+
| Bucket Lock | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/bucketLock.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/bucketLock.js,samples/README.md) |
10065
| Buckets | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/buckets.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/buckets.js,samples/README.md) |
10166
| Encryption | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/encryption.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/encryption.js,samples/README.md) |
10267
| Files | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/files.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/files.js,samples/README.md) |
68+
| Iam | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/iam.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/iam.js,samples/README.md) |
10369
| 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) |
10470
| Requester Pays | [source code](https://github.com/googleapis/nodejs-storage/blob/master/samples/requesterPays.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/requesterPays.js,samples/README.md) |
10571

106-
The [Cloud Storage Node.js Client API Reference][client-docs] documentation
72+
73+
74+
The [Google Cloud Storage Node.js Client API Reference][client-docs] documentation
10775
also contains samples.
10876

10977
## Versioning
11078

11179
This library follows [Semantic Versioning](http://semver.org/).
11280

81+
11382
This library is considered to be **General Availability (GA)**. This means it
11483
is stable; the code surface will not change in backwards-incompatible ways
11584
unless absolutely necessary (e.g. because of critical security issues) or with
11685
an extensive deprecation period. Issues and requests against **GA** libraries
11786
are addressed with the highest priority.
11887

88+
89+
90+
91+
11992
More Information: [Google Cloud Platform Launch Stages][launch_stages]
12093

12194
[launch_stages]: https://cloud.google.com/terms/launch-stages
@@ -130,7 +103,21 @@ Apache Version 2.0
130103

131104
See [LICENSE](https://github.com/googleapis/nodejs-storage/blob/master/LICENSE)
132105

133-
[client-docs]: https://cloud.google.com/nodejs/docs/reference/storage/latest/
134-
[product-docs]: https://cloud.google.com/storage/docs
135-
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
106+
## What's Next
107+
108+
* [Google Cloud Storage Documentation][product-docs]
109+
* [Google Cloud Storage Node.js Client API Reference][client-docs]
110+
* [github.com/googleapis/nodejs-storage](https://github.com/googleapis/nodejs-storage)
111+
112+
Read more about the client libraries for Cloud APIs, including the older
113+
Google APIs Client Libraries, in [Client Libraries Explained][explained].
114+
115+
[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
136116

117+
[client-docs]: https://cloud.google.com/nodejs/docs/reference/storage/2.3.x/
118+
[product-docs]: https://cloud.google.com/storage
119+
[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
120+
[projects]: https://console.cloud.google.com/project
121+
[billing]: https://support.google.com/cloud/answer/6293499#enable-billing
122+
[enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=storage-api.googleapis.com
123+
[auth]: https://cloud.google.com/docs/authentication/getting-started

synth.metadata

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"updateTime": "2019-03-08T00:45:45.355188Z",
2+
"updateTime": "2019-03-27T11:27:46.413216Z",
33
"sources": [
44
{
55
"template": {
66
"name": "node_library",
77
"origin": "synthtool.gcp",
8-
"version": "2019.1.16"
8+
"version": "2019.2.26"
99
}
1010
}
1111
]

0 commit comments

Comments
 (0)