Skip to content

Commit 0c9b2a7

Browse files
committed
Add fs commands
1 parent 2b6b9c5 commit 0c9b2a7

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

bin/cli_commands.json

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"path": "@stdlib/os/arch",
1212
"group": "system"
1313
},
14+
{
15+
"command": "bench",
16+
"description": "Run JavaScript benchmark files.",
17+
"path": "@stdlib/bench",
18+
"group": "utils"
19+
},
1420
{
1521
"command": "bundle-pkg-list",
1622
"description": "Bundle a list of stdlib packages.",
@@ -47,6 +53,12 @@
4753
"path": "@stdlib/string/ends-with",
4854
"group": "utils"
4955
},
56+
{
57+
"command": "exists",
58+
"description": "Test if a file exists.",
59+
"path": "@stdlib/fs/exists",
60+
"group": "fs"
61+
},
5062
{
5163
"command": "from-code-point",
5264
"description": "Create a string from code points.",
@@ -377,6 +389,24 @@
377389
"path": "@stdlib/os/platform",
378390
"group": "system"
379391
},
392+
{
393+
"command": "read-dir",
394+
"description": "Read all files in a directory.",
395+
"path": "@stdlib/fs/read-dir",
396+
"group": "fs"
397+
},
398+
{
399+
"command": "read-file",
400+
"description": "Read a file.",
401+
"path": "@stdlib/fs/read-file",
402+
"group": "fs"
403+
},
404+
{
405+
"command": "read-file-list",
406+
"description": "Read a list of files.",
407+
"path": "@stdlib/fs/read-file-list",
408+
"group": "fs"
409+
},
380410
{
381411
"command": "remove-first",
382412
"description": "Remove the first character in a string.",
@@ -407,6 +437,12 @@
407437
"path": "@stdlib/string/remove-words",
408438
"group": "utils"
409439
},
440+
{
441+
"command": "rename",
442+
"description": "Rename a file.",
443+
"path": "@stdlib/fs/rename",
444+
"group": "fs"
445+
},
410446
{
411447
"command": "repstr",
412448
"description": "Repeat a string.",
@@ -425,6 +461,12 @@
425461
"path": "@stdlib/string/replace",
426462
"group": "utils"
427463
},
464+
{
465+
"command": "resolve-parent-path",
466+
"description": "Resolve a path by walking parent directories.",
467+
"path": "@stdlib/fs/resolve-parent-path",
468+
"group": "fs"
469+
},
428470
{
429471
"command": "reverse",
430472
"description": "Reverse a string.",
@@ -485,10 +527,22 @@
485527
"path": "@stdlib/string/uncapitalize",
486528
"group": "utils"
487529
},
530+
{
531+
"command": "unlink",
532+
"description": "Remove a file.",
533+
"path": "@stdlib/fs/unlink",
534+
"group": "fs"
535+
},
488536
{
489537
"command": "uppercase",
490538
"description": "Uppercase a string.",
491539
"path": "@stdlib/string/uppercase",
492540
"group": "utils"
541+
},
542+
{
543+
"command": "write-file",
544+
"description": "Write to file.",
545+
"path": "@stdlib/fs/write-file",
546+
"group": "fs"
493547
}
494548
]

bin/usage.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ Assert:
5757
is-uri Assert if a value is a URI.
5858
is-whitespace Assert if a value is only whitespace.
5959

60+
Fs:
61+
62+
exists Test if a file exists.
63+
read-dir Read all files in a directory.
64+
read-file Read a file.
65+
read-file-list Read a list of files.
66+
rename Rename a file.
67+
resolve-parent-path Resolve a path by walking parent directories.
68+
unlink Remove a file.
69+
write-file Write to file.
70+
6071
Meta:
6172

6273
ls List stdlib package names.
@@ -85,6 +96,7 @@ Tools:
8596

8697
Utils:
8798

99+
bench Run JavaScript benchmark files.
88100
capitalize Capitalize the first character in a string.
89101
ends-with Test if a string ends with another string.
90102
from-code-point Create a string from code points.

0 commit comments

Comments
 (0)