0.1.3 • Published 11 years ago

dir2json-lite v0.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
11 years ago

dir2json

Use 2 CLI

install globel

npm install dir2json-lite -g

use 2 output

dir2json path/to/dir

dir2json.json output sample

{
    "path": "path/to/dir",
    "name": "folder2json",
    "type": "folder",
    "children": [
        {
            "path": "/bin",
            "name": "bin",
            "type": "folder",
            "children": [
                {
                    "path": "/bin/index.js",
                    "name": "index.js",
                    "type": "file"
                }
            ]
        },
        {
            "path": "/package.json",
            "name": "package.json",
            "type": "file"
        }
    ],
    "baseUrl": ""
}

Quick Examples

install

npm install dir2json-lite --save
//indclude core
var dir2json = require('dir2json-lite');

var input = process.argv[2];

if (!input) {
  return console.log('must given dir path.');
}

//init
var f2j = new dir2json();
f2j.rootDir = input;
f2j.baseUrl = 'http://www.github.com';
f2j.ignores = ['node_modules'];//ignore folder
//get JSON Object
var jsonObj = f2j.dir();
console.log(jsonObj);

//save file
var savePath = f2j.save();
console.log('Done!SavePath:' + savePath);

ref

0.1.3

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago