For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/conversion/stringify.md.

stringify

Produces a human-readable string from any unknown value.

Uses JSON.stringify for structured types (plain objects, arrays) so the message contains actual content instead of [object Object]. Maps and Sets are converted to their array representation first. Falls back to String() for primitives or when serialization fails (e.g. circular references).

stringify({ status: 400 })          // '{"status":400}'
stringify(new Map([['k', 'v']]))    // '[["k","v"]]'
stringify(null)                     // 'null'
stringify(42)                       // '42'

Usage

stringify(value: unknown)

Produces a human-readable string from any unknown value.

Uses JSON.stringify for structured types (plain objects, arrays) so the message contains actual content instead of [object Object]. Maps and Sets are converted to their array representation first. Falls back to String() for primitives or when serialization fails (e.g. circular references).

import { stringify } from 'massaman'
// or:  import { stringify } from 'massaman/conversion'

stringify({ status: 400 })          // '{"status":400}'
stringify(new Map([['k', 'v']]))    // '[["k","v"]]'
stringify(null)                     // 'null'
stringify(42)                       // '42'

Parameters

valueunknownrequired

the value to convert.

Returns

A meaningful string representation.

string