Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

folder2some

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

folder2some

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

  • 0.0.6
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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,{ 
    ignoreFolder: ['node_modules'],
    getFile: 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

ignoreFolder : Array : the directory be ignored.

getFile : boolean it will generate an output file.

About me

Perhaps more configuration can be extended. :)

github: https://github.com/Lemonreds

e-mail: lemonreds@163.com

Keywords

FAQs

Package last updated on 21 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc