Skip to main content

Extensions

Unofficial extensions to the Lua standard libraries

Status

Experimental: Functionality may change for any reason, without semantic versioning guarantees

Availability

Extensions are added to the existing global standard library tables. You can simply index them:

debug.dump({ 1, 2, 3 })

Debug Library

debug.dump

Prints a human-readable string representation of the given object. Mostly useful for dumping tables, but unsuitable for serialization purposes. The output format cannot be considered stable. Currently uses inspect internally, though this may change in the future.

String Library

string.diff

Returns a string representing the difference between firstValue and secondValue. The exact format is subject to change.

string.explode

Tokenizes the given inputString based on a configurable delimiter character, which is stripped from the output.

string.filesize

Returns a human-readable representation of the given fileSizeInBytes using standard units. The exact format is subject to change.

Table Library

table.contains

Returns true if the given table contains value in the array part of the table, and false otherwise. The dictionary part is ignored.

Changelog

VersionWhat happened?
v0.0.2Added string.filesize
v0.0.1Initial release