UNPKG
dtp-tripwire-agent
Version:
latest (1.0.7)
1.0.7
A service for protecting your node against malicious attacks and scans.
dtp-tripwire-agent
/
src
/
lib
/
tools.ts
9 lines
(6 loc)
•
213 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
fs
from
"node:fs"
;
async
function
readJsonFile<T>(
path
:
string
):
Promise
<T> {
const
file =
await
fs.
promises
.
readFile
(path);
return
JSON
.
parse
(file.
toString
(
"utf-8"
))
as
T; }
export
{ readJsonFile };