stringify-condense
v0.0.3
Published
pretty-formats JSON in a ways that improve list readability
Downloads
166
Readme
stringify-condense
This package pretty-formats JSON in a ways that improve list readability. Example,
import stringify from './stringify-condense.js'
stringify([
['users', [
['user', ['fred', 1, '3928']],
['user', ['jane', 2, '9271']],
['user', ['joan', 3, '9917']]
]]
])
// [
// ["users", [
// ["user", ["fred", 1, "3928"]],
// ["user", ["jane", 2, "9271"]],
// ["user", ["joan", 3, "9917"]]
// ]]
// ]
[
[
"users",
[
[
"user",
[
"fred",
1,
"3928"
]
],
[
"user",
[
"jane",
2,
"9271"
]
],
[
"user",
[
"joan",
3,
"9917"
]
]
]
]
]
Lists have many benefits over objects including; They are parsed in more predictable ways across different languages and runtimes. They hold positional data. They are more compact. In cases that do not require map-like data, lists provide lookup access that is programmatically faster and easier.
This package uses regular-expressions to re-stringify data. Please report any edge-cases where results are found to be incorrect.