-

Node.js

+

{{pageTitle}}

+ +
+ {{version}} (Latest version) + + + See version History + +
+

{{module[0].toUpperCase() + module.substr(1)}}

@@ -21,107 +30,130 @@

Getting Started with gcloud

-
-

- First, install gcloud with npm and require it into your project: -

-
$ npm install --save gcloud
-
var gcloud = require('gcloud');
-

- There are a couple of ways to use the gcloud module. -

-

- If you are running your app on Google App Engine or Google Compute Engine, you won't need to worry about supplying connection configuration options to gcloud— we figure that out for you. -

-

- However, if you're running your app elsewhere, you will need to provide this information. -

-
-// App Engine and Compute Engine -var gcloud = require('gcloud'); +
+

{{module[0].toUpperCase() + module.substr(1)}}

+

+ First, install gcloud with npm and require it into your project: +

+
$ npm install --save gcloud
+
var gcloud = require('gcloud');
+

+ There are a couple of ways to use the gcloud module. +

+

+ If you are running your app on Google App Engine or Google Compute Engine, you won't need to worry about supplying connection configuration options to gcloud— we figure that out for you. +

+

+ However, if you're running your app elsewhere, you will need to provide this information. +

+
+ // App Engine and Compute Engine + var gcloud = require('gcloud'); -// Elsewhere -var gcloud = require('gcloud')({ - keyFilename: '/path/to/keyfile.json' -});
-

- In any environment, you are free to provide these and other default properties, which eventually will be passed to the gcloud sub-modules (Datastore, Storage, etc.). -

-
-
-
-

Overview

-

- The gcloud.datastore object gives you some convenience methods, as well as exposes a dataset function. This will allow you to create a dataset, which is the object from which you will interact with the Google Cloud Datastore. -

-
-var datastore = gcloud.datastore; -var dataset = datastore.dataset({ - projectId: 'myProject', - keyFilename: '/path/to/keyfile.json' -});
-

- See the Dataset documentation for examples of how to query the datastore, save entities, run a transaction, and others. -

-
-
-

Overview

-

- The gcloud.storage object contains a bucket object, which is how you will interact with your Google Cloud Storage bucket. See the guide on Google Cloud Storage to create a bucket. -

-

- See examples below for more on how to access your bucket to upload a file, read its files, create signed URLs, and more. -

-
+ // Elsewhere + var gcloud = require('gcloud')({ + keyFilename: '/path/to/keyfile.json' + });
+

+ In any environment, you are free to provide these and other default properties, which eventually will be passed to the gcloud sub-modules (Datastore, Storage, etc.). +

+
+
+
+

Overview

+

+ The gcloud.datastore object gives you some convenience methods, as well as exposes a dataset function. This will allow you to create a dataset, which is the object from which you will interact with the Google Cloud Datastore. +

+
+ var datastore = gcloud.datastore; + var dataset = datastore.dataset({ + projectId: 'myProject', + keyFilename: '/path/to/keyfile.json' +
+

+ See the Dataset documentation for examples of how to query the datastore, save entities, run a transaction, and others. +

+
-
-

- {{method.name}} -

-

- - {{method.name}} -

-

-

Parameters

- - - - - - - - -
{{param.name}}
-

Returns

-

-

Example

-
-
+
+

+ The gcloud.storage object contains a Bucket object, which is how you will interact with your Google Cloud Storage bucket. +

+
+ var storage = gcloud.storage; + var bucket = new storage.Bucket({ + bucketName: 'MyBucket' + });
+

+ See the Dataset documentation for examples of how to query the datastore, save entities, run a transaction, and others. +

+
+
+

Overview

+

+ The gcloud.storage object contains a bucket object, which is how you will interact with your Google Cloud Storage bucket. See the guide on Google Cloud Storage to create a bucket. +

+

+ See examples below for more on how to access your bucket to upload a file, read its files, create signed URLs, and more. +

+
+ +
+

+ {{method.name}} +

+

+ + {{method.name}} +

+

+

Parameters

+ + + + + + + + +
{{param.name}}
+

Returns

+

+

Example

+
+
+
+
+