Skip to content

Commit d64d538

Browse files
authored
Switch to individual API packages. (#169)
* Switch to individual API packages. * Address comments * Address comments
1 parent f99996d commit d64d538

File tree

5 files changed

+30
-29
lines changed

5 files changed

+30
-29
lines changed

vision/samples/faceDetection.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
'use strict';
1515

1616
// [START auth]
17-
// By default, gcloud will authenticate using the service account file specified
18-
// by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use the
19-
// project specified by the GCLOUD_PROJECT environment variable. See
20-
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
21-
var gcloud = require('gcloud');
17+
// By default, the client will authenticate using the service account file
18+
// specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use
19+
// the project specified by the GCLOUD_PROJECT environment variable. See
20+
// https://googlecloudplatform.github.io/gcloud-node/#/docs/google-cloud/latest/guides/authentication
21+
var Vision = require('@google-cloud/vision');
2222

23-
// Get a reference to the vision component
24-
var vision = gcloud.vision();
23+
// Instantiate a vision client
24+
var vision = Vision();
2525
// [END auth]
2626

2727
var fs = require('fs');

vision/samples/labelDetection.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515

1616
// [START app]
1717
// [START import_libraries]
18-
var gcloud = require('gcloud');
18+
var Vision = require('@google-cloud/vision');
1919
// [END import_libraries]
2020

2121
// [START authenticate]
22-
// By default, gcloud will authenticate using the service account file specified
23-
// by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use the
24-
// project specified by the GCLOUD_PROJECT environment variable. See
25-
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
22+
// By default, the client will authenticate using the service account file
23+
// specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use
24+
// the project specified by the GCLOUD_PROJECT environment variable. See
25+
// https://googlecloudplatform.github.io/gcloud-node/#/docs/google-cloud/latest/guides/authentication
2626

27-
// Get a reference to the vision component
28-
var vision = gcloud.vision();
27+
// Instantiate a vision client
28+
var vision = Vision();
2929
// [END authenticate]
3030

3131
/**

vision/samples/landmarkDetection.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515

1616
// [START app]
1717
// [START import_libraries]
18-
var gcloud = require('gcloud');
18+
var Vision = require('@google-cloud/vision');
1919
// [END import_libraries]
2020

2121
// [START authenticate]
22-
// By default, gcloud will authenticate using the service account file specified
23-
// by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use the
24-
// project specified by the GCLOUD_PROJECT environment variable. See
25-
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
22+
// By default, the client will authenticate using the service account file
23+
// specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use
24+
// the project specified by the GCLOUD_PROJECT environment variable. See
25+
// https://googlecloudplatform.github.io/gcloud-node/#/docs/google-cloud/latest/guides/authentication
2626

27-
// Get a reference to the vision component
28-
var vision = gcloud.vision();
27+
// Instantiate a vision client
28+
var vision = Vision();
2929
// [END authenticate]
3030

3131
/**

vision/samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js"
1010
},
1111
"dependencies": {
12+
"@google-cloud/vision": "^0.1.1",
1213
"async": "^1.5.0",
13-
"gcloud": "^0.37.0",
1414
"natural": "^0.4.0",
1515
"redis": "^2.6.0-2"
1616
},

vision/samples/textDetection.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ var async = require('async');
1919
var fs = require('fs');
2020
var path = require('path');
2121

22-
// By default, gcloud will authenticate using the service account file specified
23-
// by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use the
24-
// project specified by the GCLOUD_PROJECT environment variable. See
25-
// https://googlecloudplatform.github.io/gcloud-node/#/docs/guides/authentication
26-
var gcloud = require('gcloud');
22+
// By default, the client will authenticate using the service account file
23+
// specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable and use
24+
// the project specified by the GCLOUD_PROJECT environment variable. See
25+
// https://googlecloudplatform.github.io/gcloud-node/#/docs/google-cloud/latest/guides/authentication
26+
var Vision = require('@google-cloud/vision');
2727
var natural = require('natural');
2828
var redis = require('redis');
29-
// Get a reference to the vision component
30-
var vision = gcloud.vision();
29+
30+
// Instantiate a vision client
31+
var vision = Vision();
3132
// [END import_libraries]
3233

3334
function Index () {

0 commit comments

Comments
 (0)