Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 107c55b

Browse files
committed
Writing a more readable JSON
1 parent 23f4c69 commit 107c55b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

week3/lecture/src/todo.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
'use strict';
32

43
const fs = require('fs');
@@ -68,7 +67,7 @@ class Todo {
6867
return new Promise((resolve, reject) => {
6968
fs.writeFile(
7069
this._filename,
71-
JSON.stringify(todos),
70+
JSON.stringify(todos, null, 2),
7271
error => error == null
7372
? resolve()
7473
: reject(error)

0 commit comments

Comments
 (0)