#json-file #file-tree #map

app projson

The program uses ProjFS to map json to file tree

1 unstable release

0.1.0 Jul 28, 2024

#1964 in Command line utilities

23 downloads per month

MIT and GPL-2.0 licenses

115KB
205 lines

projson

中文

This project uses ProjFS to map JSON to file tree.

introduce

Usage

Before running, please ensure that the optional Windows feature: ProjFS is enabled. To enable the ProjFS feature, you can use the following PowerShell command.

Enable-WindowsOptionalFeature -Online -FeatureName Client-ProjFS -NoRestart

After enabling the ProjFS feature, use projson --help to view the usage information.

Usage: projson.exe --prj-path <Virtual root directory path> <--json-file <Json file path>|--json-text <Json text>>

Options:
  -f, --json-file <Json file path>              Specifies the JSON file to read
  -t, --json-text <Json text>                   Specifies the JSON text to read
  -p, --prj-path <Virtual root directory path>  Specifies the virtualization root directory path
  -h, --help                                    Print help
  -V, --version                                 Print version

When mapping JSON to files or directories, the JSON key will be the file or directory name, and the type of the value will determine whether the key-value pair is mapped to a file or a directory, according to the following rules:

  • Object: Directory, the object's sub key-values are directory items.
  • Array: Directory, the elements in the array are directory items.
  • String: File, the file content is the string value.
  • Number: File, the file content is the numeric value.
  • Boolean: File, the file content is 'true' or 'false'.
  • Null: Empty file.

Example

Map JSON as a file tree from file.

projson.exe --json-file src.json --prj-path D:\dst

Dependencies

~130MB
~2M SLoC