npm.io
1.1.2 • Published 8 years ago

string-from-object

Licence
AGPL-3.0-or-later
Version
1.1.2
Deps
1
Size
39 kB
Vulns
0
Weekly
0

string-from-object

neatly formatted, indentation based presentation of js object, handles circular structures, depth levels, + logs with color

for usage, see ./module/__tests__ npm i string-from-object

import {log} from 'string-from-object'
log({some: {object: ['or', 'value']}})

import strFromObj from 'string-from-object'
console.log(strFromObj(..., {
	depth: 1, indentation: '\t', colors: false,
	filter: ({key})=> key!=='name',
	nameExtractor: obj=> obj.name,
}))

Contribute

Feel free to fork and send PR's :)

Copyright Leonard Pauli, 2017-2018

Licence: GNU Affero General Public License v3.0 or later. For commersial / closed-source / custom licencing needs, please contact us.