momokaralistfiles
遍历文件树
Last updated a month ago by momokarabugs .
ISC · Original npm · Tarball · package.json
$ cnpm install momokaralistfiles 
SYNC missed versions from official npm registry.

练习用小工具 列出指定目录的树,并且输出到指定文件

当前的命令是 mapfile

命令行使用

修改了在osx的问题

全局安装:npm install -g momokaralistfiles
输入: mapfile

项目中使用

npm install momokaralistfiles
const { listFilemap, savefilemap, mapDir} = require('momokaralistfiles')

获取文件树 object

/**
 * @description: 获取文件树
 * @param {string} dir 文件目录路径
 * @return {object} 遍历的路径树
 */
listFilemap(dir)

获取并保存文件树


/**
 * @param {string} dir 文件目录路径
 * @param {string} outputPath 输出文件路径
 */
savefilemap(dir, outputPath)

合并当前目录下的js文件

let path = require('path')
let dir = path.join(__dirname,'.')
/**
 * @param {string} dir 文件目录路径
 */
module.exports = mapDir(dir)

会读取 第一次遍历目录下的 fileMapConfig.json 文件 作为配置
fileInfo:文件说明; typeIcon:后缀类型的图标; banList:不遍历的文件夹;
{
  "fileInfo": {
    "data": "????数据文件",
    "bin": "使用function"
  },
  "typeIcon": {
    "scss": "????",
    "file": "????",
    "action": "????",
    "reducers": "????",
    "class": "????",
    "html": "????",
    "d": "????",
    "png": "????",
    "tsx": "????"
  },
  "banList": [
    "node_modules",
    "static",
    "dist"
  ]
}

data 文件夹下有一些配置可以修改 github

Current Tags

  • 1.0.11                                ...           latest (a month ago)

10 Versions

  • 1.0.11                                ...           a month ago
  • 1.0.10                                ...           a month ago
  • 1.0.9                                ...           a month ago
  • 1.0.8                                ...           a month ago
  • 1.0.7                                ...           a month ago
  • 1.0.6                                ...           a month ago
  • 1.0.5                                ...           a month ago
  • 1.0.3                                ...           2 months ago
  • 1.0.2                                ...           2 months ago
  • 1.0.1                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 20
Last Day 1
Last Week 4
Last Month 124
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |