public
/
json_cache_rw.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ffef9a8
)
Make JSON.stringify pretty print
author
Nick Downing
<nick@ndcode.org>
Fri, 31 Dec 2021 20:21:40 +0000
(07:21 +1100)
committer
Nick Downing
<nick@ndcode.org>
Fri, 31 Dec 2021 20:21:40 +0000
(07:21 +1100)
JSONCacheRW.js
patch
|
blob
|
history
diff --git
a/JSONCacheRW.js
b/JSONCacheRW.js
index
5d49668
..
4e1f28d
100644
(file)
--- a/
JSONCacheRW.js
+++ b/
JSONCacheRW.js
@@
-91,7
+91,7
@@
let write = (pathname, result, timeout, diag) => {
console.log('writing', pathname)
result.dirty = false
let temp_pathname = pathname + '.temp'
- let text = JSON.stringify(result.value) + '\n'
+ let text = JSON.stringify(result.value
, null, 2
) + '\n'
try {
await fs_writeFile(temp_pathname, text, {encoding: 'utf-8'})
try {