UNPKG
@forabi/memfs
Version:
latest (2.7.2)
2.7.2
In-memory file-system with Node's fs API.
github.com/streamich/memfs
streamich/memfs
@forabi/memfs
/
demo
/
write.ts
11 lines
(7 loc)
•
216 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{fs}
from
'../src/index'
;
const
fd = fs.
openSync
(
'/test.txt'
,
'w'
);
const
data =
'123'
; fs.
write
(fd,
Buffer
.
from
(data),
(
err, bytes, buf
) =>
{
// console.log(err, bytes, buf);
fs.
closeSync
(fd); });