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"

最新文章

  1. python基础六
  2. canvas 绘制 矩形 圆形
  3. 把 HttpHandler.ashx 修改为 异步编程 异步操作
  4. 难搞的EXCHANGE重新安装错误
  5. Cookie及Session文件在本机的存放位置
  6. Linq中的多表左联,详细语句
  7. 老李分享:《Java Performance》笔记1——性能分析基础 1
  8. Java这些冷知识你知道吗?
  9. 2712:细菌繁殖-poj
  10. Pycharm配置(三)
  11. Python学习日记:day9--------函数
  12. BZOJ_3365_[Usaco2004 Feb]Distance Statistics 路程统计&&POJ_1741_Tree_点分治
  13. 23 , CSS 构造列表与导航
  14. 20175314 实验二 Java面向对象程序设计
  15. Codeforces 514C Watto and Mechanism 【Trie树】+【DFS】
  16. answer my questions from the book<构建之法>.
  17. Fiddler抓包5-接口测试(Composer)
  18. 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.>
  19. WPF编程,通过Double Animation动态旋转控件的一种方法。
  20. scheme 之门

热门文章

  1. linux复制和移动
  2. LeetCode:N叉树的最大深度【559】
  3. P4298 [CTSC2008]祭祀
  4. Vagrant + Vbox实战 【转】
  5. C#多线程编程介绍——使用thread、threadpool、timer
  6. C/C++语法知识点汇总
  7. kettle脚本定时任务不执行
  8. Python IOError: [Errno 13] Permission denied:
  9. HiHoCoder1671 : 反转子串([Offer收割]编程练习赛41)(占位)
  10. ACM学习历程—BestCoder 2015百度之星资格赛1004 放盘子(策略 && 计算几何)