0.0.9 • Published 7 years ago

folder2some v0.0.9

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

folder2some

folder2some is a simple util to convert folder into some structures(like JSON,Tree,Info).

Installation

npm install folder2some

Usage

import foder2some

let FT = require('folder2some'),
    dir = 'F://web//javascript';

let ft = new FT(dir,{ 
    ignore: ['node_modules'],
    generateFile: true
})

console.log(ft.toTree())
console.log(ft.toJSON())
console.log(ft.toAnalysis())

Output maybe like :

├─clone               
│   └─cloner.js       
├─es6                 
│   └─es6.js          
├─filestype           
│   ├─test.js         
│   └─ft.js           
├─gallery             
│   ├─utils.js        
│   ├─gallery.styl    
│   └─gallery.js      
├─zepto               
│   ├─test            
│   │   ├─test2       
│   │   │   └─2.html  
│   │   └─1.html      
│   ├─test2           
│   └─zepto.js        
├─text.html           
└─1.html  
[                        
  "1.html",              
  {                      
    "clone": [           
      "cloner.js"        
    ]                    
  },                     
  {                      
    "es6": [             
      "es6.js"           
    ]                    
  },                     
  {                      
    "filestype": [       
      "ft.js",           
      "test.js"          
    ]                    
  },                     
  {                      
    "gallery": [         
      "gallery.js",      
      "gallery.styl",    
      "utils.js"         
    ]                    
  },                     
  "text.html",           
  {                      
    "zepto": [           
      {                  
        "test": [        
          "1.html",      
          {              
            "test2": [   
              "2.html"   
            ]            
          }              
        ]                
      },                 
      {                  
        "test2": []      
      },                 
      "zepto.js"         
    ]                    
  }                      
]                       
{
  "path": "F://web//javascript",
  "totalSize": "85.56KB",
  "totalCount": 12,
  "extPercent": [
    {
      "ext": ".html",
      "percent": "0.00",
      "count": 4
    },
    {
      "ext": ".js",
      "percent": "99.04",
      "count": 7
    },
    {
      "ext": ".styl",
      "percent": "0.96",
      "count": 1
    }
  ]
}          

Options

ignore : Array: the directory be ignored.

generateFile : boolean it will generate an output file.

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago