Skip to content

quickjs-modules/xdump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xdump

xdump is a javascript dump function for QuickJS applications.

Usage

import xdump from "./path/to/xdump.js";

xdump("foo", 42, null);
xdump("", new Map([["France", "Paris"], ["Germany", "Berlin"]], [1, 2, 3]);
[dump] foo 42 null
[dump] 'empty_string' Map(2) [France: Paris, Germany: Berlin] Array(3) [1, 2, 3]

Types

  • null, undefined
  • string
  • number
  • symbol
  • object
    • Array
    • Object
    • Map
    • Set

Config

const log = xdump.configure({ delimiter: " | ", prefix: "[log]" });

log("foo", 42, null);
[log] foo | 42 | null

Options

Option Descrition Default
delimiter Delimiter to put between fields " "
finalNewline Add a newline after every output true
prefix Prefix to add to every output [dump]