Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.117.106.206
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp-musonza /
node_modules /
fs-extra /
docs /
Delete
Unzip
Name
Size
Permission
Date
Action
copy-sync.md
1.43
KB
-rw-r--r--
2017-03-13 14:27
copy.md
1.81
KB
-rw-r--r--
2017-05-04 23:39
emptyDir-sync.md
393
B
-rw-r--r--
2017-03-13 14:27
emptyDir.md
625
B
-rw-r--r--
2017-05-04 23:39
ensureDir-sync.md
394
B
-rw-r--r--
2017-03-13 14:27
ensureDir.md
580
B
-rw-r--r--
2017-05-04 23:39
ensureFile-sync.md
480
B
-rw-r--r--
2017-03-13 14:27
ensureFile.md
672
B
-rw-r--r--
2017-05-04 23:39
ensureLink-sync.md
428
B
-rw-r--r--
2017-03-13 14:27
ensureLink.md
636
B
-rw-r--r--
2017-05-04 23:39
ensureSymlink-sync.md
468
B
-rw-r--r--
2017-03-13 14:27
ensureSymlink.md
677
B
-rw-r--r--
2017-05-04 23:39
move-sync.md
511
B
-rw-r--r--
2017-03-13 14:27
move.md
832
B
-rw-r--r--
2017-05-04 23:39
outputFile-sync.md
729
B
-rw-r--r--
2017-03-13 14:27
outputFile.md
1
KB
-rw-r--r--
2017-05-04 23:39
outputJson-sync.md
617
B
-rw-r--r--
2017-03-13 14:27
outputJson.md
898
B
-rw-r--r--
2017-05-04 23:39
pathExists-sync.md
174
B
-rw-r--r--
2017-04-27 19:06
pathExists.md
643
B
-rw-r--r--
2017-04-27 19:06
readJson-sync.md
797
B
-rw-r--r--
2017-03-13 14:27
readJson.md
1.18
KB
-rw-r--r--
2017-05-04 23:39
remove-sync.md
299
B
-rw-r--r--
2017-03-13 14:27
remove.md
603
B
-rw-r--r--
2017-05-04 23:39
writeJson-sync.md
495
B
-rw-r--r--
2017-03-13 14:27
writeJson.md
736
B
-rw-r--r--
2017-05-04 23:39
Save
Rename
# readJson(file, [options, callback]) Reads a JSON file and then parses it into an object. `options` are the same that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback). **Alias:** `readJSON()` - `file` `<String>` - `options` `<Object>` - `callback` `<Function>` ## Example: ```js const fs = require('fs-extra') fs.readJson('./package.json', (err, packageObj) => { if (err) console.error(err) console.log(packageObj.version) // => 0.1.3 }) // Promise Usage fs.readJson('./package.json') .then(packageObj => { console.log(packageObj.version) // => 0.1.3 }) .catch(err => { console.error(err) }) ``` --- `readJson()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example: ```js const fs = require('fs-extra') const file = '/tmp/some-invalid.json' const data = '{not valid JSON' fs.writeFileSync(file, data) fs.readJson(file, { throws: false }, (err, obj) => { if (err) console.error(err) console.log(obj) // => null }) // Promise Usage fs.readJson(file, { throws: false }) .then(obj => { console.log(obj) // => null }) .catch(err => { console.error(err) // Not called }) ```