diff --git a/error-reporting/quickstart.js b/error-reporting/quickstart.js index b938e3d580..41cfb75b81 100644 --- a/error-reporting/quickstart.js +++ b/error-reporting/quickstart.js @@ -19,7 +19,11 @@ function quickstart() { // [START error_reporting_quickstart] // Imports the Google Cloud client library - const ErrorReporting = require('@google-cloud/error-reporting'); + const ErrorReporting = require('@google-cloud/error-reporting') + .ErrorReporting; + + // On Node 6+ the following syntax can be used instead: + // const {ErrorReporting} = require('@google-cloud/error-reporting'); // Instantiates a client const errors = ErrorReporting(); diff --git a/error-reporting/snippets.js b/error-reporting/snippets.js index 9f8bc7b300..a1ae59c5c3 100644 --- a/error-reporting/snippets.js +++ b/error-reporting/snippets.js @@ -18,7 +18,11 @@ function setupImplicit() { // [START error_reporting_setup_implicit] // Imports the Google Cloud client library - const ErrorReporting = require('@google-cloud/error-reporting'); + const ErrorReporting = require('@google-cloud/error-reporting') + .ErrorReporting; + + // On Node 6+ the following syntax can be used instead: + // const {ErrorReporting} = require('@google-cloud/error-reporting'); // Instantiates a client const errors = ErrorReporting(); @@ -31,7 +35,11 @@ function setupImplicit() { function setupExplicit() { // [START error_reporting_setup_explicit] // Imports the Google Cloud client library - const ErrorReporting = require('@google-cloud/error-reporting'); + const ErrorReporting = require('@google-cloud/error-reporting') + .ErrorReporting; + + // On Node 6+ the following syntax can be used instead: + // const {ErrorReporting} = require('@google-cloud/error-reporting'); // Instantiates a client const errors = ErrorReporting({ @@ -47,7 +55,11 @@ function setupExplicit() { function manual() { // [START error_reporting_manual] // Imports the Google Cloud client library - const ErrorReporting = require('@google-cloud/error-reporting'); + const ErrorReporting = require('@google-cloud/error-reporting') + .ErrorReporting; + + // On Node 6+ the following syntax can be used instead: + // const {ErrorReporting} = require('@google-cloud/error-reporting'); // Instantiates a client const errors = ErrorReporting(); @@ -81,7 +93,11 @@ function express() { const express = require('express'); // Imports the Google Cloud client library - const ErrorReporting = require('@google-cloud/error-reporting'); + const ErrorReporting = require('@google-cloud/error-reporting') + .ErrorReporting; + + // On Node 6+ the following syntax can be used instead: + // const {ErrorReporting} = require('@google-cloud/error-reporting'); // Instantiates a client const errors = ErrorReporting();