|
第1个笔记稍后整理再发吧,一个简单的文件示例,找出某目录下的文件列表,并打印出来。
/*
* Created by xa87 on 2016/1/19.
*/
var fs=require('fs');
- var cheerio=require('cheerio');
- //var cheerio=require('http');
var path=require('path');
- fs.readdir('f:\\mail',function(err,files){
- files.forEach(function(item){
- console.log(item);
- })
- })
复制代码执行结果:"C:\Program Files (x86)\JetBrains\WebStorm 10.0.3\bin\runnerw.exe" "C:\Program Files\nodejs\node.exe" test.js
00000145.eml
00000146.eml
00000147.eml
00000148.eml
00000149.eml
0000014a.eml
0000014b.eml
0000014c.eml
Process finished with exit code 0
|
|