Class: Structured

Structured

new Structured()

/** Provider for structured text data such as CSS, HTML, JSON etc.

Methods

css()

Generates a random snippet of CSS.

cssProperty()

Generates a random snippet of CSS that assigns value to a property.

html() → {*}

Generate a random HTML tag with text inside and some attrs set.
Returns:
Type
*

htmlAttrValue(opts)

Random value for specified HTML tag attribute.
Parameters:
Name Type Description
opts object Options
Properties
Name Type Description
tag string HTML Tag.
attr string An attribute of the specified tag.

json(opts) → {*}

Generate random JSON snippet.
Parameters:
Name Type Description
opts object options
Properties
Name Type Description
number number Number of top-level items to produce.
maxDepth number Maximum depth of each top-level item.
recursive boolean When used recursively, will return a Python object instead of JSON string.
Returns:
Type
*