UNPKG
@withstudiocms/internal_helpers
Version:
beta (0.1.0-beta.1)
latest (0.1.0-beta.3)
0.1.0-beta.3
0.1.0-beta.2
0.1.0-beta.1
Internal helper utilities for StudioCMS
studiocms.dev
withstudiocms/studiocms
@withstudiocms/internal_helpers
/
dist
/
utils
/
jsonUtils.js
13 lines
(12 loc)
•
254 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
import
fs
from
"node:fs"
;
function
jsonParse
(
text
) {
return
JSON
.
parse
(text); }
function
readJson
(
path, readFileSync = fs.readFileSync
) {
const
content =
readFileSync
(path,
"utf-8"
);
return
jsonParse
(content); }
export
{ jsonParse, readJson };