1.0.0 • Published 7 years ago

file-info v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

file-info

npm npm Build Status

Traverse the current directory and display the file information

使用

npm安装

npm i --save file-info

在Node.js中使用

//引入模块
const fileInfo=require('file-info');


/**
 * 获取文件夹目录数组
 * @param  {String}  [use_path='']   文件夹路径
 * @param  {Array}   [ignoreArr=[]]  忽略的文件夹
 * @param  {Boolean} [isIgnore=true] 是否忽略默认文件夹,默认为true
 * @return {Array}                   返回一个Promise对象,回调函数参数为文件夹数组
 */
fileInfo.showList('./directory-path').then((data)=>{
    console.log(data);
});


/**
 * 获取文件夹详细信息
 * @param  {String}  [use_path='']   文件夹路径
 * @param  {Array}   [ignoreArr=[]]  忽略的文件数组
 * @param  {Boolean} [isIgnore=true] 是否忽略默认文件夹
 * @return {Array}                  返回一个Promise对象,回调函数参数为数组,包括所有文件总行数、总中文字数、总英文字数、总标点符号数以及文件总大小(totalLine、chineseNum、endlishNum、sizeNum)
 */
info.showDetail('./directory-path').then((data)=>{
    console.log(data);
});

LICENSE

MIT License

1.0.0

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago