Skip to content

Commit b7370d6

Browse files
committed
chore(node-fs): enhance demo test
1 parent 8fc2749 commit b7370d6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/node-fs/demo/node-fs.mjs

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
import {writeJsonFile, WriteFileMode} from '@alwatr/node-fs';
1+
import {readJson, writeJson} from '@alwatr/node-fs';
22

3-
for (let i = 10; i > 0; i--) {
4-
console.log('request write file %s without waiting...', i);
5-
writeJsonFile('./file.json', {i, a: 'b'}, WriteFileMode.Rename);
3+
for (let i = 0; i < 100; i++) {
4+
console.log('writeJson %s without waiting...', i);
5+
writeJson('file.json', {i, a: 'b'});
6+
if (i===70) {
7+
console.log('readJson %s', i);
8+
console.dir(await readJson('file.json'));
9+
}
610
}
711

12+
console.dir(await readJson('file.json'));
13+
814
console.log('loop done, wait for queue process')

0 commit comments

Comments
 (0)