cruks-lib-string-builder
v1.2.2
Published
Partially mimics behavior of classic StringBuilder class but stays aware of user-requested message verbosity.
Downloads
94
Readme
cruks-lib-string-builder
Partially mimics behavior of classic StringBuilder class but stays aware of user-requested message verbosity.
Examples
Plain string concatenation
var StringBuilder = require("cruks-lib-string-builder").StringBuilder,
sb = new StringBuilder(" ");
sb.append("hello").append("world").toString(); // "hello world"
Appending item dumps with different verbosity levels
var StringBuilder = require("cruks-lib-string-builder").StringBuilder,
sb = new StringBuilder();
sb.appendDump([1, "2", 3]).toString(); // "array"
var StringBuilder = require("cruks-lib-string-builder").StringBuilder,
verbosity = require("cruks-lib-verbosity-indicator").verbosity,
sb = new StringBuilder("", verbosity.high);
sb.appendDump([1, "2", 3]).toString(); // "(array)[number,string,number]"