Built motion from commit 10af8726.|2.6.34
[motion2.git] / legacy-libs / google-proto-files / README.md
1 <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
2
3 # [googleapis Proto Files: Node.js Client](https://github.com/googleapis/nodejs-proto-files)
4
5 [![release level](https://img.shields.io/badge/release%20level-alpha-orange.svg?style&#x3D;flat)](https://cloud.google.com/terms/launch-stages)
6 [![npm version](https://img.shields.io/npm/v/google-proto-files.svg)](https://www.npmjs.org/package/google-proto-files)
7 [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-proto-files/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-proto-files)
8
9 > Get a copy of the [googleapis](https://github.com/googleapis/googleapis) proto files into your project.
10
11 * [github.com/googleapis/nodejs-proto-files](https://github.com/googleapis/nodejs-proto-files)
12
13 Read more about the client libraries for Cloud APIs, including the older
14 Google APIs Client Libraries, in [Client Libraries Explained][explained].
15
16 [explained]: https://cloud.google.com/apis/docs/client-libraries-explained
17
18 **Table of contents:**
19
20 * [Usage](#usage)
21 * [Versioning](#versioning)
22 * [Contributing](#contributing)
23 * [License](#license)
24
25 ## Usage
26
27 ```sh
28 $ npm install --save google-proto-files
29 ```
30 ```js
31 const protoFiles = require('google-proto-files')
32 ```
33
34 ### Get a directory path by executing as a function
35 ```js
36 protoFiles('logging', 'v2')
37 // node_modules/google-proto-files/google/logging/v2
38 ```
39
40 ### Get a path to the entry proto file for a specific API version
41 ```js
42 protoFiles.pubsub.v1
43 // node_modules/google-proto-files/google/pubsub/v1/pubsub.proto
44 ```
45
46 ## load|loadSync(fileName, [options])
47
48 ### [options](https://github.com/dcodeIO/protobuf.js/blob/master/src/parse.js#L42-L44)
49
50 ### Load a proto which depends on google common protos.
51 #### Asynchronously
52 ```js
53 protoFiles.load('path/to/file.proto').then(function(root) {
54   const MyService = root.lookup('example.MyService')
55 })
56   ```
57
58 #### Synchronously
59 ```js
60 const root = protoFiles.loadSync('path/to/file.proto');
61 const MyService = root.lookup('example.MyService');
62 ```
63
64 ## Versioning
65
66 This library follows [Semantic Versioning](http://semver.org/).
67
68 This library is considered to be in **alpha**. This means it is still a
69 work-in-progress and under active development. Any release is subject to
70 backwards-incompatible changes at any time.
71
72 More Information: [Google Cloud Platform Launch Stages][launch_stages]
73
74 [launch_stages]: https://cloud.google.com/terms/launch-stages
75
76 ## Contributing
77
78 Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-proto-files/blob/master/CONTRIBUTING.md).
79
80 ## License
81
82 Apache Version 2.0
83
84 See [LICENSE](https://github.com/googleapis/nodejs-proto-files/blob/master/LICENSE)
85