@vnodes/fs
Preparing search index...
createSafeIO
Function createSafeIO
createSafeIO
(
rootPath
:
string
,
)
:
{
readJsonFile
:
<
T
>
(
filePath
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
T
>
;
readTextFile
:
(
filePath
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
string
>
;
readYamlFile
:
(
filePath
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
unknown
>
;
updateJsonFile
:
<
T
>
(
filePath
:
string
,
updateFn
:
(
value
:
T
)
=>
T
,
controller
?:
AbortController
,
)
=>
Promise
<
T
>
;
updateYamlFile
:
<
T
>
(
filePath
:
string
,
updateFn
:
(
value
:
T
)
=>
T
,
controller
?:
AbortController
,
)
=>
Promise
<
T
>
;
writeJsonFile
:
<
T
>
(
filePath
:
string
,
content
:
T
,
controller
?:
AbortController
,
)
=>
Promise
<
void
>
;
writeTextFile
:
(
filePath
:
string
,
content
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
void
>
;
writeYamlFile
:
<
T
>
(
filePath
:
string
,
content
:
T
,
controller
?:
AbortController
,
)
=>
Promise
<
void
>
;
}
Create a scopped IO functions
Parameters
rootPath
:
string
Returns
{
readJsonFile
:
<
T
>
(
filePath
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
T
>
;
readTextFile
:
(
filePath
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
string
>
;
readYamlFile
:
(
filePath
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
unknown
>
;
updateJsonFile
:
<
T
>
(
filePath
:
string
,
updateFn
:
(
value
:
T
)
=>
T
,
controller
?:
AbortController
,
)
=>
Promise
<
T
>
;
updateYamlFile
:
<
T
>
(
filePath
:
string
,
updateFn
:
(
value
:
T
)
=>
T
,
controller
?:
AbortController
,
)
=>
Promise
<
T
>
;
writeJsonFile
:
<
T
>
(
filePath
:
string
,
content
:
T
,
controller
?:
AbortController
,
)
=>
Promise
<
void
>
;
writeTextFile
:
(
filePath
:
string
,
content
:
string
,
controller
?:
AbortController
,
)
=>
Promise
<
void
>
;
writeYamlFile
:
<
T
>
(
filePath
:
string
,
content
:
T
,
controller
?:
AbortController
,
)
=>
Promise
<
void
>
;
}
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
@vnodes/fs
Loading...
Create a scopped IO functions