跳至主要内容

从目录结构创建json树

项目描述

此工具从目录的文件层次结构创建json树结构。

用法

dir2json --pretty test/

在一个像这样的目录中

test
├── bar
│   └── symlink.png -> ../foo/test.png
└── foo
    ├── test.jpg
    └── test.pn

生成以下json输出

{
    "type": "directory",
    "path": "",
    "index": [
        {
            "type": "directory",
            "path": "foo",
            "index": [
                {
                    "type": "image/jpeg",
                    "path": "foo/test.jpg"
                },
                {
                    "type": "image/png",
                    "path": "foo/test.png"
                }
            ]
        },
        {
            "type": "directory",
            "path": "bar",
            "index": [
                {
                    "type": "image/png",
                    "link": "foo/test.png",
                    "path": "bar/symlink.png"
                }
            ]
        }
    ]
}

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解安装包的更多信息。

源分布

dir2json-0.1.0.tar.gz (2.1 kB 查看哈希值)

上传时间

由以下机构支持