function readPath(_path){
    let obj = {}, values = [], name;

    if(!_path)
        return "";

    name = _path.substr(_path.lastIndexOf(path.sep) + 1);
    

    // Determine whether the _path is dir or not
    let stat = fs.statSync(_path)

    if(stat.isFile()){
        return name;
    }else if(stat.isDirectory()){
        obj["name"] = name;
        obj["values"] = values;

        let sub_children = readDir(_path);

        sub_children.forEach((e)=>{
            let resolve = readPath(path.resolve(_path, e));
            values.push(resolve)
        })

    }

    return obj;
}
/**
 * Read all path recursively and record the path relations
 */
Read all path recursively and record the path relations
Read all path recursively and record the path relations
function readPath(_path){
    let obj = {}, values = [], name;
    if(!_path)
        return "";
    name = _path.substr(_path.lastIndexOf(path.sep) + 1);
    let stat = fs.statSync(_path)
    if(stat.isFile()){
        return name;
    }else if(stat.isDirectory()){
        obj["name"] = name;
        obj["values"] = values;
        let sub_children = readDir(_path);
        sub_children.forEach((e)=>{
            let resolve = readPath(path.resolve(_path, e));
            values.push(resolve)
        })
    }
    return obj;
}
function readPath ( _path ) { let obj = { } , values = [ ] , name ; if ( ! _path ) return "" ; name = _path . substr ( _path . lastIndexOf ( path . sep ) + 1 ) ; let stat = fs . statSync ( _path ) if ( stat . isFile ( ) ) { return name ; } else if ( stat . isDirectory ( ) ) { obj [ "name" ] = name ; obj [ "values" ] = values ; let sub_children = readDir ( _path ) ; sub_children . forEach ( ( e ) => { let resolve = readPath ( path . resolve ( _path , e ) ) ; values . push ( resolve ) } ) } return obj ; }
Read all path recursively and record the path relations
Read all path recursively and record the path relations
// Determine whether the _path is dir or not