Google Cloud Platform logo

Google APIs Proto Files: Node.js Client

release level npm version codecov

All of the Google API's protocol buffer files

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Installing the client library

bash npm install google-proto-files

Using the API

js const protoFiles = require('google-proto-files')

Get a directory path by executing as a function

js protoFiles('logging', 'v2') // node_modules/google-proto-files/google/logging/v2

Get a path to the entry proto file for a specific API version

js protoFiles.pubsub.v1 // node_modules/google-proto-files/google/pubsub/v1/pubsub.proto

load|loadSync(fileName, [options])

options

Load a proto which depends on google common protos.

Asynchronously

js protoFiles.load('path/to/file.proto').then(function(root) { const MyService = root.lookup('example.MyService') })

Synchronously

js const root = protoFiles.loadSync('path/to/file.proto'); const MyService = root.lookup('example.MyService');

The Google APIs Proto Files Node.js Client API Reference documentation also contains samples.

Versioning

This library follows Semantic Versioning.

This library is considered to be General Availability (GA). This means it is stable; the code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against GA libraries are addressed with the highest priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE

result-matching ""

    No results matching ""