Format Specification

This page describes the NiceDump version 1.0 format.


A parsable NiceDump is created in the following way:

  1. Create a JSON representation of the object.
  2. Base64-encode the JSON data.
  3. Prepend the line =====BEGIN NICE-DUMP===== to the result.
  4. Append the line =====END NICE-DUMP===== to the result.
The NiceDump block SHOULD be enclosed by HTML comments <!-- and -->


This example will create a NiceDump for the string variable "Foo Bar".

Create the JSON representation:

{ "name": "My String", "value": "Foo Bar", "type": "string", "size": 7 }


ewogICAgIm5hbWUiOiAiTXkgU3RyaW5nIiwKICAgICJ2YWx1ZSI6ICJGb28gQmFyIiwKICAgICJ0 eXBlIjogInN0cmluZyIsCiAgICAic2l6ZSI6IDcKfQ==

Prepend and append the NiceDump header and footer:

=====BEGIN NICE-DUMP===== ewogICAgIm5hbWUiOiAiTXkgU3RyaW5nIiwKICAgICJ2YWx1ZSI6ICJGb28gQmFyIiwKICAgICJ0 eXBlIjogInN0cmluZyIsCiAgICAic2l6ZSI6IDcKfQ== =====END NICE-DUMP=====

Done! A NiceDump reader can now parse this and might display something like this:

My String: "Foo Bar" string[7]


An item corresponds to a basic entry in the NiceDump.


A comment for the item.

Name comment
Type string
Example {"comment": "Internal class"}

Is static

Tells whether the item is static or not. Default value is false.

Name isStatic
Type bool
Example {"isStatic": true}


A list of items.

Items is an array of objects where each contains an optional key and a mandatory value. The key and value contains each another item.

Name items
Type array
Example {"items": [ {"key": {…}, "value": {…}}, {"value": {…}} ]}


The name of the item.

Name name
Type string
Example {"name": "Foo Bar"}


The relation between the item and a parent item.

Name rel
Type string
Example {"rel": "parent"}
Relation MAY be parent (for a parent class item).


The size of the item, e.g. the size of an array or a string.

Name size
Type number
Example {"size": 4}


The native type name for the item or any of _group_, _text_.

Name type
Type string
Example {"type": "string"}
Type MUST be any of null, bool, int, float, string, array, object, resource, _group_, _text_.

Type name

The specific name for the type, e.g. the class name for an object.

Name typeName
Type string
Example {"typeName": "FooClass"}


The value to display for the item.

Name Value
Type string
Example {"value": "42"}


The visibility for the item.

Name visibility
Type string
Example {"visibility": "public"}
Visibility MUST be any of public, protected, private.