File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11import { promises as fs } from "node:fs" ;
22async function listDir ( ) {
3- const flag = process . argv [ 2 ] ;
4- const fileNamePattern = process . argv [ 3 ] || process . cwd ( ) ;
5- console . log ( fileNamePattern ) ;
6- console . log ( flag ) ;
3+ const flag = process . argv [ 2 ] ;
4+ const fileNamePattern = process . argv [ 3 ] || process . cwd ( ) ;
5+ // console.log(fileNamePattern);
6+ // console.log(flag);
77 const fileListArray = await fs . readdir ( fileNamePattern ) ;
8- console . log ( fileListArray ) ;
9-
8+ const visibleFileListArray = fileListArray . filter ( file => ! file . startsWith ( '.' ) ) ;
9+ //console.log(fileListArray);
10+ //console.log(visibleFileListArray);
1011
11- for ( const item of fileListArray ) {
12+ for ( const item of visibleFileListArray ) {
1213 console . log ( item ) ;
1314 }
1415
You can’t perform that action at this time.
0 commit comments