BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/flat-cache/src
Run
Logout
Edit File
Size: 876 B
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/flat-cache/src/utils.js
Text
Base64
const fs = require('fs'); const path = require('path'); const flatted = require('flatted'); function tryParse(filePath, defaultValue) { let result; try { result = readJSON(filePath); } catch (ex) { result = defaultValue; } return result; } /** * Read json file synchronously using flatted * * @param {String} filePath Json filepath * @returns {*} parse result */ function readJSON(filePath) { return flatted.parse( fs.readFileSync(filePath, { encoding: 'utf8', }) ); } /** * Write json file synchronously using circular-json * * @param {String} filePath Json filepath * @param {*} data Object to serialize */ function writeJSON(filePath, data) { fs.mkdirSync(path.dirname(filePath), { recursive: true, }); fs.writeFileSync(filePath, flatted.stringify(data)); } module.exports = { tryParse, readJSON, writeJSON };
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 3
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
cache.js
5.76 KB
lrw-r--r--
2025-03-28 11:04:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
del.js
777 B
lrw-r--r--
2025-03-28 11:04:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
utils.js
876 B
lrw-r--r--
2025-03-28 11:04:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).