Node.js 内置模块fs的readdir方法 查看某个文件夹里面包含的文件内容
2024-10-20 09:20:57
fs.readdir(path[, options], callback)
例:
"use strict"; const fs = require("fs"); const path = require("path"); //获取当前文件所在的绝对路径 let filepath = path.resolve(); fs.readdir(filepath, "utf-8", function(err, files){ if(err) { console.log(err); } else { console.log(files); } });
注:第二个参数不写的话默认为 "utf-8"
最新文章
- python基础六
- canvas 绘制 矩形 圆形
- 把 HttpHandler.ashx 修改为 异步编程 异步操作
- 难搞的EXCHANGE重新安装错误
- Cookie及Session文件在本机的存放位置
- Linq中的多表左联,详细语句
- 老李分享:《Java Performance》笔记1——性能分析基础 1
- Java这些冷知识你知道吗?
- 2712:细菌繁殖-poj
- Pycharm配置(三)
- Python学习日记:day9--------函数
- BZOJ_3365_[Usaco2004 Feb]Distance Statistics 路程统计&;&;POJ_1741_Tree_点分治
- 23 , CSS 构造列表与导航
- 20175314 实验二 Java面向对象程序设计
- Codeforces 514C Watto and Mechanism 【Trie树】+【DFS】
- answer my questions from the book<;构建之法>;.
- Fiddler抓包5-接口测试(Composer)
- BEA-290074 <;Deployment service servlet received file download request for file ";security/SerializedSystemIni.dat";. The file may exist, but download of this file is not allowed.>;
- WPF编程,通过Double Animation动态旋转控件的一种方法。
- scheme 之门
热门文章
- linux复制和移动
- LeetCode:N叉树的最大深度【559】
- P4298 [CTSC2008]祭祀
- Vagrant + Vbox实战 【转】
- C#多线程编程介绍——使用thread、threadpool、timer
- C/C++语法知识点汇总
- kettle脚本定时任务不执行
- Python IOError: [Errno 13] Permission denied:
- HiHoCoder1671 : 反转子串([Offer收割]编程练习赛41)(占位)
- ACM学习历程—BestCoder 2015百度之星资格赛1004 放盘子(策略 &;&; 计算几何)