# 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