tli

0.0.1 • Public • Published

Tli NPM version Build Status Coverage Status

Tree command emulator

CLI

Installation

$ npm install tli --global
$ tli -V
# 0.0.0 
 
$ tli --help
# 
#  Usage: tli /path/to/dir 
# 
#  Options: 
# 
#    -h, --help          output usage information 
#    -L --level <level>  Descend only level directories deep. 
#    -j --json           Output json 

Try

$ tli
.
├─ cli.spec.coffee
├─ fixtures
│  ├─ foo
│  │  ├─ bar
│  │  │  └─ beep
│  │  └─ baz
│  └─ hoge
│     ├─ fuga
│     ├─ ninja
│     │  └─ nande
│     │     └─ aieeee
│     └─ piyo
│        └─ guwa-
└─ index.coffee
 
10 directories, 10 files

API

$ npm install tli --save

.treeSync(path) -> {file,directory,tree}

File and directory synchronous searching.

var tli= require('tli');
 
var result= tli.treeSync(__dirname);
console.log(result);
// {
//   file: 2,
//   directory: 3,
//
//   tree: {
//     baz: {
//       beep: 1024,//bytes
//       boop: 2048,
//     },
//     foo: {
//       bar: {},
//     },
//     noop: {},
//   },
// }

.stringify(tree) -> treeString

Prettify the tree object

var tli= require('tli');
var result= tli.treeSync(__dirname);
var tree= tli.stringify(result.tree);
 
console.log(tree);
//├─ baz
//│  ├─ beep
//│  └─ boop
//├─ foo
//│  └─ bar
//└─ noop

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i tli

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • 59naga