Skip to content

Commit

Permalink
fix: Update README partials to mention how to use import (#1400)
Browse files Browse the repository at this point in the history
* Update READM partials to mention how to use import

GitHub issue #1398 indicates that a specific incantation is required when using "import" with the trace-agent. This PR updates the README to mention this.

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
dnoe and gcf-owl-bot[bot] committed Nov 16, 2021
1 parent 9805bd1 commit da8741b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .readme-partials.yaml
Expand Up @@ -18,6 +18,12 @@ body: |-
require('@google-cloud/trace-agent').start();
// ...
```
If you want to use `import`, you will need to do the following to import all required types:
```
import * as TraceAgent from '@google-cloud/trace-agent';
```
Optionally, you can pass a [configuration object](https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/config.ts) to the `start()` function as follows:
Expand Down
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -73,6 +73,12 @@ require('@google-cloud/trace-agent').start();
// ...
```

If you want to use `import`, you will need to do the following to import all required types:

```
import * as TraceAgent from '@google-cloud/trace-agent';
```

Optionally, you can pass a [configuration object](https://github.com/googleapis/cloud-trace-nodejs/blob/master/src/config.ts) to the `start()` function as follows:

<!-- TODO(kjin): Generate documentation from the public interface of the Trace Agent, and link it here. -->
Expand Down

0 comments on commit da8741b

Please sign in to comment.