# Namespace: Util

## ProtoBuf. Util

ProtoBuf utilities.

Source:
  - ProtoBuf.js, line 261

### Members

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

  Flag if running in node (fs is available) or not.

  ##### Type:

  - boolean
  Source:
    - ProtoBuf.js, line 269

### 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 313

  ##### Returns:

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

  Type
    string | undefined

#### (static) isArray(obj) → {boolean}

  Tests if an object is an array.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `obj` | * | Object to test

  Source:
    - ProtoBuf.js, line 363

  ##### Returns:

  true if it is an array, else false

  Type
    boolean

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

  Constructs a XMLHttpRequest object.

  Source:
    - ProtoBuf.js, line 285

  ##### Throws:

  If XMLHttpRequest is not supported
  Type
    Error

  ##### Returns:

  Type
    XMLHttpRequest