# Namespace: Util

## ProtoBuf. Util

ProtoBuf utilities.

Source:
  - protobuf.js, line 304

### Members

#### (static, constant) IS_NODE :boolean

Flag if running in node or not.

##### Type:

- boolean

Source:
  - protobuf.js, line 312

### Methods

#### (static) fetch(path, callbackopt) → {string|undefined}

Fetches a resource.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`path` | string |  | Resource path
`callback` | function | <optional> | Callback receiving the resource's contents. If omitted the resource will be fetched synchronously. If the request failed, contents will be null.

Source:
  - protobuf.js, line 350

##### Returns:

Resource contents if callback is omitted (null if the request failed), else undefined.

Type
  string | undefined

#### (static) toCamelCase(str) → {string}

Converts a string to camel case.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string |

Source:
  - protobuf.js, line 400

##### Returns:

Type
  string

#### (static) XHR() → {XMLHttpRequest}

Constructs a XMLHttpRequest object.

Source:
  - protobuf.js, line 322

##### Throws:

If XMLHttpRequest is not supported

Type
  Error

##### Returns:

Type
  XMLHttpRequest