[node小工具]node实现linux下Tree -L命令
发布于 6 年前 作者 zzzs 2708 次浏览 来自 分享

node小工具系列之node-tree: node实现linux下Tree -L命令

github:https://github.com/zzzs/node-tree

实现

  • fs模块递归算法
  • cli-color实现console高亮

效果

1 展示所有目录

tree

tree2.png

node …/node-tree/index.js

ntree2.png

2 展示指定目录级数

tree -L 1

tree1.png

node node-tree/index.js -L 1

ntree1.png

3 【拓展】展示指定目录

ntree3.png

8 回复

@i5ting 谢谢狼叔,最近计划通过一些模块来实现一些小工具,希望能从中得到提升进步,哈哈哈

@Shasharoman 谢谢,一起学习进步👍

已经提了第一个issue以及PR,请review. :)

@kenshinji 已merge,感谢变量定义地建议 From Noder

@zzzs 客气,后来我想了下,其实let/const的检查完全可以通过eslint来做, 参考这个 https://eslint.org/docs/rules/prefer-const

@kenshinji 好的 棒棒哒

回到顶部