diff --git a/.gitignore b/.gitignore index cf927442c09..73c5f4abc8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +packages/google-cloud/README.md +packages/*/AUTHORS +packages/*/CONTRIBUTORS +packages/*/COPYING **/node_modules **/coverage/* docs/json/**/*.json diff --git a/README.md b/README.md index bbb4aaa32a4..8193f2c7458 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,22 @@ If you are not running this client on Google Compute Engine, you need a Google D 1. Visit the [Google Developers Console][dev-console]. 2. Create a new project or click on an existing project. 3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * BigQuery API + * Cloud Bigtable API + * Cloud Bigtable Admin API + * Cloud Bigtable Table Admin API * Google Cloud Datastore API + * Google Cloud DNS API + * Google Cloud Logging API + * Google Cloud Natural Language API + * Google Cloud Pub/Sub API + * Google Cloud Resource Manager API * Google Cloud Storage * Google Cloud Storage JSON API + * Google Cloud Vision API + * Google Compute Engine API + * Google Translate API + * Prediction API 4. Navigate to **APIs & auth** > **Credentials** and then: * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. @@ -463,6 +476,7 @@ var storage = require('@google-cloud/storage'); ```js var fs = require('fs'); + // Authenticating on a per-API-basis. You don't need to do this if you auth on a // global basis (see Authentication section above). @@ -1082,7 +1096,7 @@ Apache 2.0 - See [COPYING](COPYING) for more information. [cloud-bigquery-docs]: https://cloud.google.com/bigquery/what-is-bigquery -[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs/ +[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs [cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-compute-instance [cloud-compute-docs]: https://cloud.google.com/compute/docs diff --git a/packages/bigquery/README.md b/packages/bigquery/README.md new file mode 100644 index 00000000000..0291cc978d4 --- /dev/null +++ b/packages/bigquery/README.md @@ -0,0 +1,89 @@ +# @google-cloud/bigquery +> Google BigQuery Client Library for Node.js + +*Looking for more Google APIs than just BigQuery? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-bigquery-docs] +- [Official Documentation][cloud-bigquery-docs] + + +```sh +$ npm install --save @google-cloud/bigquery +``` +```js +var bigquery = require('@google-cloud/bigquery')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Access an existing dataset and table. +var schoolsDataset = bigquery.dataset('schools'); +var schoolsTable = schoolsDataset.table('schoolsData'); + +// Import data into a table. +schoolsTable.import('/local/file.json', function(err, job) {}); + +// Get results from a query job. +var job = bigquery.job('job-id'); + +// Use a callback. +job.getQueryResults(function(err, rows) {}); + +// Or get the same results as a readable stream. +job.getQueryResults().on('data', function(row) {}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var bigQuery = require('@google-cloud/bigquery')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * BigQuery API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var bigQuery = require('@google-cloud/bigquery')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-bigquery-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery +[cloud-bigquery-docs]: https://cloud.google.com/bigquery/what-is-bigquery diff --git a/packages/bigtable/README.md b/packages/bigtable/README.md new file mode 100644 index 00000000000..a921f54c58a --- /dev/null +++ b/packages/bigtable/README.md @@ -0,0 +1,109 @@ +# @google-cloud/bigtable +> Google Cloud Bigtable Client Library for Node.js + +*Looking for more Google APIs than just Bigtable? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-bigtable-docs] +- [Official Documentation][cloud-bigtable-docs] + +*You may need to [create a cluster][cloud-bigtable-cluster] to use the Google Cloud Bigtable API with your project.* + + +```sh +$ npm install --save @google-cloud/bigtable +``` +```js +var bigtable = require('@google-cloud/bigtable')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json', + zone: 'my-zone', + cluster: 'my-cluster' +}); + +var table = bigtable.table('prezzy'); + +table.getRows(function(err, rows) {}); + +// Update a row in your table. +var row = table.row('alincoln'); + +row.save('follows:gwashington', 1, function(err) { + if (err) { + // Error handling omitted. + } + + row.get('follows:gwashington', function(err, data) { + if (err) { + // Error handling omitted. + } + + // data = { + // follows: { + // gwashington: [ + // { + // value: 1 + // } + // ] + // } + // } + }); +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var bigtable = require('@google-cloud/bigtable')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Cloud Bigtable API + * Cloud Bigtable Admin API + * Cloud Bigtable Table Admin API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var bigtable = require('@google-cloud/bigtable')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-bigtable-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigtable +[cloud-bigtable-docs]: https://cloud.google.com/bigtable/docs +[cloud-bigtable-cluster]: https://cloud.google.com/bigtable/docs/creating-compute-instance \ No newline at end of file diff --git a/packages/compute/README.md b/packages/compute/README.md new file mode 100644 index 00000000000..2cdcad935c3 --- /dev/null +++ b/packages/compute/README.md @@ -0,0 +1,88 @@ +# @google-cloud/compute +> Google Compute Engine Client Library for Node.js + +*Looking for more Google APIs than just Compute Engine? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-compute-docs] +- [Official Documentation][cloud-compute-docs] + + +```sh +$ npm install --save @google-cloud/compute +``` +```js +var gce = require('@google-cloud/compute')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Create a new VM using the latest OS image of your choice. +var zone = gce.zone('us-central1-a'); +var name = 'ubuntu-http'; + +zone.createVM(name, { os: 'ubuntu' }, function(err, vm, operation) { + // `operation` lets you check the status of long-running tasks. + + operation + .on('error', function(err) {}) + .on('running', function(metadata) {}) + .on('complete', function() { + // Virtual machine created! + }); +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var gce = require('@google-cloud/compute')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Compute Engine API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var gce = require('@google-cloud/compute')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-compute-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/compute +[cloud-compute-docs]: https://cloud.google.com/compute/docs diff --git a/packages/datastore/README.md b/packages/datastore/README.md new file mode 100644 index 00000000000..0dc84da450b --- /dev/null +++ b/packages/datastore/README.md @@ -0,0 +1,108 @@ +# @google-cloud/datastore +> Google Cloud Datastore Client Library for Node.js + +*Looking for more Google APIs than just Datastore? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-datastore-docs] +- [Official Documentation][cloud-datastore-docs] + +*Follow the [activation instructions][cloud-datastore-activation] to use the Google Cloud Datastore API with your project.* + +```sh +$ npm install --save @google-cloud/datastore +``` +```js +var datastore = require('@google-cloud/datastore')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +var key = datastore.key(['Product', 'Computer']); + +datastore.get(key, function(err, entity) { + console.log(err || entity); +}); + +// Save data to Datastore. +var blogPostData = { + title: 'How to make the perfect homemade pasta', + author: 'Andrew Chilton', + isDraft: true +}; + +var blogPostKey = datastore.key('BlogPost'); + +datastore.save({ + key: blogPostKey, + data: blogPostData +}, function(err) { + // `blogPostKey` has been updated with an ID so you can do more operations + // with it, such as an update. + blogPostData.isDraft = false; + + datastore.save({ + key: blogPostKey, + data: blogPostData + }, function(err) { + if (!err) { + // The blog post is now published! + } + }); +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var datastore = require('@google-cloud/datastore')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Datastore API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var datastore = require('@google-cloud/datastore')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-datastore-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/datastore +[cloud-datastore-docs]: https://cloud.google.com/datastore/docs +[cloud-datastore-activation]: https://cloud.google.com/datastore/docs/activate diff --git a/packages/dns/README.md b/packages/dns/README.md new file mode 100644 index 00000000000..fe22246c48f --- /dev/null +++ b/packages/dns/README.md @@ -0,0 +1,93 @@ +# @google-cloud/dns +> Google Cloud DNS Client Library for Node.js + +*Looking for more Google APIs than just DNS? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-dns-docs] +- [Official Documentation][cloud-dns-docs] + + +```sh +$ npm install --save @google-cloud/dns +``` +```js +var dns = require('@google-cloud/dns')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Create a managed zone. +dns.createZone('my-new-zone', { + dnsName: 'my-domain.com.' +}, function(err, zone) {}); + +// Reference an existing zone. +var zone = dns.zone('my-existing-zone'); + +// Create an NS record. +var nsRecord = zone.record('ns', { + ttl: 86400, + name: 'my-domain.com.', + data: 'ns-cloud1.googledomains.com.' +}); + +zone.addRecord(nsRecord, function(err, change) {}); + +// Create a zonefile from the records in your zone. +zone.export('/zonefile.zone', function(err) {}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var dns = require('@google-cloud/dns')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud DNS API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var dns = require('@google-cloud/dns')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-dns-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/dns +[cloud-dns-docs]: https://cloud.google.com/dns/docs diff --git a/packages/language/README.md b/packages/language/README.md new file mode 100644 index 00000000000..bea30e2e030 --- /dev/null +++ b/packages/language/README.md @@ -0,0 +1,123 @@ +# @google-cloud/language +> Google Cloud Natural Language Client Library for Node.js + +> **This is a Beta release of Google Cloud Natural Language.** This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. + +*Looking for more Google APIs than just Natural Language? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-language-docs] +- [Official Documentation][cloud-language-docs] + + +```sh +$ npm install --save @google-cloud/language +``` +```js +var language = require('@google-cloud/language')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +var language = language({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Get the entities from a sentence. +language.detectEntities('Stephen of Michigan!', function(err, entities) { + // entities = { + // people: ['Stephen'], + // places: ['Michigan'] + // } +}); + +// Create a document if you plan to run multiple detections. +var document = language.document('Contributions welcome!'); + +// Analyze the sentiment of the document. +document.detectSentiment(function(err, sentiment) { + // sentiment = 100 // Large numbers represent more positive sentiments. +}); + +// Parse the syntax of the document. +document.annotate(function(err, annotations) { + // annotations = { + // language: 'en', + // sentiment: 100, + // entities: {}, + // sentences: ['Contributions welcome!'], + // tokens: [ + // { + // text: 'Contributions', + // partOfSpeech: 'Noun (common and proper)', + // partOfSpeechTag: 'NOUN' + // }, + // { + // text: 'welcome', + // partOfSpeech: 'Verb (all tenses and modes)', + // partOfSpeechTag: 'VERB' + // }, + // { + // text: '!', + // partOfSpeech: 'Punctuation', + // partOfSpeechTag: 'PUNCT' + // } + // ] + // } +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var language = require('@google-cloud/language')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Natural Language API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var language = require('@google-cloud/language')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-language-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/language +[cloud-language-docs]: https://cloud.google.com/natural-language/docs diff --git a/packages/logging/README.md b/packages/logging/README.md new file mode 100644 index 00000000000..a9752390e4b --- /dev/null +++ b/packages/logging/README.md @@ -0,0 +1,105 @@ +# @google-cloud/logging +> Google Cloud Logging Client Library for Node.js + +*Looking for more Google APIs than just Logging? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-logging-docs] +- [Official Documentation][cloud-logging-docs] + + +```sh +$ npm install --save @google-cloud/logging +``` +```js +var logging = require('@google-cloud/logging')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Create a sink using a Bucket as a destination. +// $ npm install --save @google-cloud/storage +var gcs = require('@google-cloud/storage'); + +logging.createSink('my-new-sink', { + destination: gcs.bucket('my-sink') +}, function(err, sink) {}); + +// Write a critical entry to a log. +var syslog = logging.log('syslog'); + +var resource = { + type: 'gce_instance', + labels: { + zone: 'global', + instance_id: '3' + } +}; + +var entry = syslog.entry(resource, { + delegate: process.env.user +}); + +syslog.critical(entry, function(err) {}); + +// Get all entries in your project. +logging.getEntries(function(err, entries) { + if (!err) { + // `entries` contains all of the entries from the logs in your project. + } +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var logging = require('@google-cloud/logging')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Logging API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var logging = require('@google-cloud/logging')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-logging-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/logging +[cloud-logging-docs]: https://cloud.google.com/logging/docs \ No newline at end of file diff --git a/packages/prediction/README.md b/packages/prediction/README.md new file mode 100644 index 00000000000..ed735915fec --- /dev/null +++ b/packages/prediction/README.md @@ -0,0 +1,103 @@ +# @google-cloud/prediction +> Google Prediction API Client Library for Node.js + +*Looking for more Google APIs than just Prediction? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-prediction-docs] +- [Official Documentation][cloud-prediction-docs] + + +```sh +$ npm install --save @google-cloud/prediction +``` +```js +var prediction = require('@google-cloud/prediction')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Get all of the trained models in your project. +prediction.getModels(function(err, models) { + if (!err) { + // `models` is an array of Model objects. + } +}); + +// Reference an existing trained model. +var model = prediction.model('my-existing-model'); + +// Train a model. +model.train('english', 'Hello from your friends at Google!', function(err) {}); + +// Query a model. +model.query('Hello', function(err, results) { + if (!err) { + // results.winner == 'english' + // results.scores == [ + // { + // label: 'english', + // score: 1 + // }, + // { + // label: 'spanish', + // score: 0 + // } + // ] + } +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var prediction = require('@google-cloud/prediction')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Prediction API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var prediction = require('@google-cloud/prediction')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-prediction-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/prediction +[cloud-prediction-docs]: https://cloud.google.com/prediction/docs diff --git a/packages/prediction/package.json b/packages/prediction/package.json index 599e8023386..c3837bbf132 100644 --- a/packages/prediction/package.json +++ b/packages/prediction/package.json @@ -2,7 +2,7 @@ "name": "@google-cloud/prediction", "version": "0.1.1", "author": "Google Inc.", - "description": "Google Cloud Prediction Client Library for Node.js", + "description": "Google Prediction API Client Library for Node.js", "contributors": [ { "name": "Burcu Dogan", diff --git a/packages/pubsub/README.md b/packages/pubsub/README.md new file mode 100644 index 00000000000..8cd929de5aa --- /dev/null +++ b/packages/pubsub/README.md @@ -0,0 +1,98 @@ +# @google-cloud/pubsub +> Google Cloud Pub/Sub Client Library for Node.js + +*Looking for more Google APIs than just Pub/Sub? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-pubsub-docs] +- [Official Documentation][cloud-pubsub-docs] + + +```sh +$ npm install --save @google-cloud/pubsub +``` +```js +var pubsub = require('@google-cloud/pubsub')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Reference a topic that has been previously created. +var topic = pubsub.topic('my-topic'); + +// Publish a message to the topic. +topic.publish({ + data: 'New message!' +}, function(err) {}); + +// Subscribe to the topic. +var options = { + reuseExisting: true +}; + +topic.subscribe('subscription-name', options, function(err, subscription) { + // Register listeners to start pulling for messages. + function onError(err) {} + function onMessage(message) {} + subscription.on('error', onError); + subscription.on('message', onMessage); + + // Remove listeners to stop pulling for messages. + subscription.removeListener('message', onMessage); + subscription.removeListener('error', onError); +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var pubsub = require('@google-cloud/pubsub')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Pub/Sub API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var pubsub = require('@google-cloud/pubsub')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-pubsub-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/pubsub +[cloud-pubsub-docs]: https://cloud.google.com/pubsub/docs diff --git a/packages/resource/README.md b/packages/resource/README.md new file mode 100644 index 00000000000..fb737c303c9 --- /dev/null +++ b/packages/resource/README.md @@ -0,0 +1,89 @@ +# @google-cloud/resource +> Google Cloud Resource Manager Client Library for Node.js + +> **This is a Beta release of Google Cloud Resource Manager.** This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. + +*Looking for more Google APIs than just Resource Manager? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-resource-docs] +- [Official Documentation][cloud-resource-docs] + + +```sh +$ npm install --save @google-cloud/resource +``` +```js +var resource = require('@google-cloud/resource')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Get all of the projects you maintain. +resource.getProjects(function(err, projects) { + if (!err) { + // `projects` contains all of your projects. + } +}); + +// Get the metadata from your project. (defaults to `grape-spaceship-123`) +var project = resource.project(); + +project.getMetadata(function(err, metadata) { + // `metadata` describes your project. +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var resource = require('@google-cloud/resource')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Resource Manager API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var resource = require('@google-cloud/resource')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-resource-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/resource +[cloud-resource-docs]: https://cloud.google.com/resource-manager diff --git a/packages/resource/package.json b/packages/resource/package.json index b5402a07573..d34fa6fc76a 100644 --- a/packages/resource/package.json +++ b/packages/resource/package.json @@ -2,7 +2,7 @@ "name": "@google-cloud/resource", "version": "0.1.1", "author": "Google Inc.", - "description": "Google Cloud Resource Client Library for Node.js", + "description": "Google Cloud Resource Manager Client Library for Node.js", "contributors": [ { "name": "Burcu Dogan", diff --git a/packages/storage/README.md b/packages/storage/README.md new file mode 100644 index 00000000000..3b294672eca --- /dev/null +++ b/packages/storage/README.md @@ -0,0 +1,107 @@ +# @google-cloud/storage +> Google Cloud Storage Client Library for Node.js + +*Looking for more Google APIs than just Storage? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-storage-docs] +- [Official Documentation][cloud-storage-docs] + + +```sh +$ npm install --save @google-cloud/storage +``` +```js +var fs = require('fs'); + +var gcs = require('@google-cloud/storage')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Create a new bucket. +gcs.createBucket('my-new-bucket', function(err, bucket) { + if (!err) { + // "my-new-bucket" was successfully created. + } +}); + +// Reference an existing bucket. +var bucket = gcs.bucket('my-existing-bucket'); + +// Upload a local file to a new file to be created in your bucket. +bucket.upload('/photos/zoo/zebra.jpg', function(err, file) { + if (!err) { + // "zebra.jpg" is now in your bucket. + } +}); + +// Download a file from your bucket. +bucket.file('giraffe.jpg').download({ + destination: '/photos/zoo/giraffe.jpg' +}, function(err) {}); + +// Streams are also supported for reading and writing files. +var remoteReadStream = bucket.file('giraffe.jpg').createReadStream(); +var localWriteStream = fs.createWriteStream('/photos/zoo/giraffe.jpg'); +remoteReadStream.pipe(localWriteStream); + +var localReadStream = fs.createReadStream('/photos/zoo/zebra.jpg'); +var remoteWriteStream = bucket.file('zebra.jpg').createWriteStream(); +localReadStream.pipe(remoteWriteStream); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var gcs = require('@google-cloud/storage')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Storage + * Google Cloud Storage JSON API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var gcs = require('@google-cloud/storage')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-storage-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/storage +[cloud-storage-docs]: https://cloud.google.com/storage/docs/overview diff --git a/packages/translate/README.md b/packages/translate/README.md new file mode 100644 index 00000000000..759c8c55f58 --- /dev/null +++ b/packages/translate/README.md @@ -0,0 +1,55 @@ +# @google-cloud/translate +> Google Translate API Client Library for Node.js + +*Looking for more Google APIs than just Translate? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-translate-docs] +- [Official Documentation][cloud-translate-docs] + +**An API key is required for Translate.** See [Identifying your application to Google][api-key-howto]. + + +```sh +$ npm install --save @google-cloud/translate +``` +```js +var translate = require('@google-cloud/translate')({ + key: 'API Key' +}); + +// Translate a string of text. +translate.translate('Hello', 'es', function(err, translation) { + if (!err) { + // translation = 'Hola' + } +}); + +// Detect a language from a string of text. +translate.detect('Hello', function(err, results) { + if (!err) { + // results = { + // language: 'en', + // confidence: 1, + // input: 'Hello' + // } + } +}); + +// Get a list of supported languages. +translate.getLanguages(function(err, languages) { + if (!err) { + // languages = [ + // 'af', + // 'ar', + // 'az', + // ... + // ] + } +}); +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[api-key-howto]: https://cloud.google.com/translate/v2/using_rest#auth +[gcloud-translate-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/translate +[cloud-translate-docs]: https://cloud.google.com/translate/docs diff --git a/packages/translate/package.json b/packages/translate/package.json index 4ebdbf60728..f5c25beca9e 100644 --- a/packages/translate/package.json +++ b/packages/translate/package.json @@ -2,7 +2,7 @@ "name": "@google-cloud/translate", "version": "0.1.1", "author": "Google Inc.", - "description": "Google Cloud Translate Client Library for Node.js", + "description": "Google Translate API Client Library for Node.js", "contributors": [ { "name": "Burcu Dogan", diff --git a/packages/vision/README.md b/packages/vision/README.md new file mode 100644 index 00000000000..181871ba81b --- /dev/null +++ b/packages/vision/README.md @@ -0,0 +1,165 @@ +# @google-cloud/vision +> Google Cloud Vision Client Library for Node.js + +> **This is a Beta release of Google Cloud Vision.** This feature is not covered by any SLA or deprecation policy and may be subject to backward-incompatible changes. + +*Looking for more Google APIs than just Vision? You might want to check out [`google-cloud`][google-cloud].* + +- [API Documentation][gcloud-vision-docs] +- [Official Documentation][cloud-vision-docs] + + +```sh +$ npm install --save @google-cloud/vision +``` +```js +var vision = require('@google-cloud/vision')({ + projectId: 'grape-spaceship-123', + keyFilename: '/path/to/keyfile.json' +}); + +// Read the text from an image. +vision.detectText('./image.jpg', function(err, text) { + // text = [ + // 'This was text found in the image', + // 'This was more text found in the image' + // ] +}); + +// Detect faces and the locations of their features in an image. +vision.detectFaces('./image.jpg', function(err, faces) { + // faces = [ + // { + // angles: {pan,tilt,roll}, + // bounds: { + // head: [{x,y},{x,y},{x,y},{x,y}], + // face: [{x,y},{x,y},{x,y},{x,y}] + // }, + // features: { + // confidence: 34.489909, + // chin: { + // center: {x,y,z}, + // left: {x,y,z}, + // right: {x,y,z} + // }, + // ears: { + // left: {x,y,z}, + // right: {x,y,z} + // }, + // eyebrows: { + // left: { + // left: {x,y,z}, + // right: {x,y,z}, + // top: {x,y,z} + // }, + // right: { + // left: {x,y,z}, + // right: {x,y,z}, + // top: {x,y,z} + // } + // }, + // eyes: { + // left: { + // bottom: {x,y,z}, + // center: {x,y,z}, + // left: {x,y,z}, + // pupil: {x,y,z}, + // right: {x,y,z}, + // top: {x,y,z} + // }, + // right: { + // bottom: {x,y,z}, + // center: {x,y,z}, + // left: {x,y,z}, + // pupil: {x,y,z}, + // right: {x,y,z}, + // top: {x,y,z} + // } + // }, + // forehead: {x,y,z}, + // lips: { + // bottom: {x,y,z}, + // top: {x,y,z} + // }, + // mouth: { + // center: {x,y,z}, + // left: {x,y,z}, + // right: {x,y,z} + // }, + // nose: { + // bottom: { + // center: {x,y,z}, + // left: {x,y,z}, + // right: {x,y,z} + // }, + // tip: {x,y,z}, + // top: {x,y,z} + // } + // }, + // confidence: 56.748849, + // blurry: false, + // dark: false, + // happy: false, + // hat: false, + // mad: false, + // sad: false, + // surprised: false + // } + // ] +}); +``` + + +## Authentication + +It's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services. + +### On Google Compute Engine + +If you are running this client on Google Compute Engine, we handle authentication for you with no configuration. You just need to make sure that when you [set up the GCE instance][gce-how-to], you add the correct scopes for the APIs you want to access. + +``` js +// Authenticating on a global basis. +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var vision = require('@google-cloud/vision')({ + projectId: projectId +}); + +// ...you're good to go! +``` + +### Elsewhere + +If you are not running this client on Google Compute Engine, you need a Google Developers service account. To create a service account: + +1. Visit the [Google Developers Console][dev-console]. +2. Create a new project or click on an existing project. +3. Navigate to **APIs & auth** > **APIs section** and turn on the following APIs (you may need to enable billing in order to use these services): + * Google Cloud Vision API +4. Navigate to **APIs & auth** > **Credentials** and then: + * If you want to use a new service account, click on **Create new Client ID** and select **Service account**. After the account is created, you will be prompted to download the JSON key file that the library uses to authenticate your requests. + * If you want to generate a new key for an existing service account, click on **Generate new JSON key** and download the JSON key file. + +``` js +var projectId = process.env.GCLOUD_PROJECT; // E.g. 'grape-spaceship-123' + +var vision = require('@google-cloud/vision')({ + projectId: projectId, + + // The path to your key file: + keyFilename: '/path/to/keyfile.json' + + // Or the contents of the key file: + credentials: require('./path/to/keyfile.json') +}); + +// ...you're good to go! +``` + + +[google-cloud]: https://github.com/GoogleCloudPlatform/google-cloud-node/ +[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using +[dev-console]: https://console.developers.google.com/project +[gcloud-vision-docs]: https://googlecloudplatform.github.io/google-cloud-node/#/docs/vision +[cloud-vision-docs]: https://cloud.google.com/vision/docs diff --git a/scripts/publish.js b/scripts/publish.js index 54f17c4e9b5..97e06f92038 100755 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -35,6 +35,7 @@ var tagName = [moduleName, newVersion].join('-'); if (moduleName === 'google-cloud') { tagName = ('v' + newVersion); + cp(path.join(__dirname, '../README.md'), cwd); } // Increment the version