forked from googleapis/google-cloud-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.html
More file actions
176 lines (156 loc) · 7.26 KB
/
home.html
File metadata and controls
176 lines (156 loc) · 7.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<section class="hero-banner">
<div class="container clearfix">
<div class="quote-box">
<h1>google-cloud</h1>
<p>Cloud Client Library for Node.js
- an idiomatic, intuitive, and natural way for Node.js developers to
integrate with Google Cloud Platform services, like Cloud Datastore
and Cloud Storage.</p>
</div>
<div class="quote-box--supplementary">
<pre class="skip-highlight"><code class="subtle--blue">$</code> npm install <code class="subtle--blue">--save</code> <strong>google-cloud</strong></pre>
<h4 class="latest-release subtle" ng-if="home.latestRelease">
Latest Release <a ng-href="https://github.com/GoogleCloudPlatform/google-cloud-node/releases/tag/v{{home.module.version}}" class="latest-release--link white">{{home.module.version}}</a>
</h4>
</div>
</div><!-- end of .container -->
</section><!-- end of .hero-banner -->
<section class="block featuring">
<div class="container">
<ul class="featuring-links">
<li>
<a href="#/docs/{{home.module.name}}/{{home.module.version}}/{{home.module.service}}" title="google-cloud docs" class="btn btn-docs">
<img src="src/images/icon-lang-node-cta.svg" alt="Node.js icon" />
Read the Docs
</a>
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/google-cloud-node" title="google-cloud on GitHub" class="ext-link">
<img src="src/images/icon-link-github.svg" alt="GitHub icon" />
GitHub
</a>
</li>
<li>
<a href="https://github.com/GoogleCloudPlatform/google-cloud-node/issues" title="google-cloud issues on Github" class="ext-link">
<img src="src/images/icon-link-github.svg" alt="GitHub icon" />
Issues
</a>
</li>
<li>
<a href="http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js" title="google-cloud on StackOverflow" class="ext-link">
<img src="src/images/icon-link-stackoverflow.svg" alt="StackOverflow icon" />
StackOverflow
</a>
</li>
<li>
<a href="http://npmjs.org/package/google-cloud" title="google-cloud on npm" class="ext-link">
<img src="src/images/icon-link-package-manager.svg" alt="npm icon" />
npm
</a>
</li>
</ul>
</div><!-- end of .container -->
</section><!-- end of .featuring -->
<section class="block about">
<div class="container clearfix">
<div class="quote-box">
<h3 class="block-title">What is it?</h3>
<p><code>google-cloud</code> is a client library for accessing Google
Cloud Platform services that significantly reduces the boilerplate
code you have to write. The library provides high-level API
abstractions so they're easier to understand. It embraces
idioms of Node.js, works well with the standard library, and
integrates better with your codebase.
All this means you spend more time creating code that matters
to you.</p>
<p><code>google-cloud</code> is configured to access Google Cloud Platform
services and authenticate (OAuth 2.0) automatically on your behalf.
With a one-line install and a private key, you are up and ready
to go. Better yet, if you are running on a Google Compute Engine
instance, the one-line install is enough!</p>
</div>
<div class="quote-box--supplementary">
<h4>Example: Upload a file to Cloud Storage</h4>
<div class="code-sample-tabs" ng-init="selected = 'compute engine'">
<a ng-click="selected = 'compute engine'"
ng-class="{selected: selected == 'compute engine'}"
>Run in Compute Engine</a>
<a ng-click="selected = 'elsewhere'"
ng-class="{selected: selected == 'elsewhere'}"
>Run elsewhere</a>
</div>
<div hljs hlsj-language="js" ng-show="selected == 'compute engine'">
// Authentication is automatic
// inside Google Compute Engine.
var gcloud = require('google-cloud')();
var gcs = gcloud.storage();
var backups = gcs.bucket('backups');
backups.upload('db.zip', function(err, file) {
// file.createReadStream();
// file.getMetadata();
// ...
});</div>
<div hljs hljs-language="js" ng-show="selected == 'elsewhere'">
var gcloud = require('google-cloud')({
projectId: 'grape-spaceship-123',
// Specify a path to a keyfile.
keyFilename: '/path/to/keyfile.json'
});
var gcs = gcloud.storage();
var backups = gcs.bucket('backups');
backups.upload('db.zip', function(err, file) {
// file.createReadStream();
// file.getMetadata();
// ...
});</div>
</div>
</div><!-- end of .container -->
</section><!-- end of .featuring -->
<section class="block examples">
<div class="container clearfix">
<h3 class="block-title">Examples</h3>
<ul>
<li>
<a href="https://cloud.google.com/nodejs">Getting Started with Compute Engine and Node.js</a> (<em><a href="https://github.com/GoogleCloudPlatform/nodejs-getting-started">source</a></em>) - A tutorial for building a web application on Google Cloud Platform.
</li>
<li>
<a href="http://gcloud-todos.appspot.com">TodoMVC</a> (<em><a href="https://github.com/GoogleCloudPlatform/gcloud-node-todos">source</a></em>) - TodoMVC backend using google-cloud and Express.
</li>
<li>
<a href="https://github.com/stephenplusplus/gcloud-kvstore">gcloud-kvstore</a> - Use a google-cloud dataset as a Key/Value store.
</li>
<li>
<a href="http://gitnpm.com/">gitnpm</a> (<em><a href="https://github.com/stephenplusplus/gitnpm">source</a></em>) - Easily lookup an npm package's GitHub repo using google-cloud and Google App Engine.
</li>
<li>
<a href="https://github.com/sebelga/gstore-node">gstore-node</a> - Google Datastore Entities Modeling library.
</li>
<li>
<a href="https://github.com/sebelga/gstore-api">gstore-api</a> - REST API builder for Google Datastore Entities.
</li>
</ul>
</div>
</section>
<section class="block">
<div class="container clearfix">
<h3 class="block-title">FAQ</h3>
<h4>What is the relationship between the <code>google-cloud</code> package
and the <code>gcloud</code> command-line tool?</h4>
<p>Both the <code>gcloud</code> command-line tool and
<code>google-cloud</code> package are a part of the Cloud SDK: a collection
of tools and libraries that enable you to easily create and manage
resources on the Google Cloud Platform. The <code>gcloud</code> command-line
tool can be used to manage both your development workflow and your
Google Cloud Platform resources while the <code>google-cloud</code> package is the
Cloud Client Library for Node.js.</p>
<h4>What is the relationship between <code>google-cloud</code>
and the Google APIs Node.js Client?</h4>
<p>The <a href="https://github.com/google/google-api-nodejs-client">
Google APIs Node.js Client</a> is a client library for
using the broad set of Google APIs.
<code>google-cloud</code> is built specifically for the Google Cloud Platform
and is the recommended way to integrate Cloud APIs into your
Node.js applications. If your application requires both Google Cloud Platform and
other Google APIs, the 2 libraries may be used by your application.</p>
</div>
</section> <!-- end of FAQ -->