dirjson

command module
v0.0.0-...-3e15a43 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2018 License: MIT Imports: 8 Imported by: 0

README

Dirjson

The simple command-line tool to list directories and files in JSON. Written in Golang.

Installation

To compile you need to have Golang already installed and configured on your computer. Then:

  1. Copy
$ git clone https://github.com/VMois/dirjson.git
$ cd dirjson
  1. Download dependencies and build
$ go get
$ go build -o dirjson.go
  1. Run
$ ./dirjson -p

Usage

  • To get help:
$ ./dirjson -h
  • to specify directory:
$ ./dirjson -d ./test_dir
  • pretty JSON output of current directory:
$ ./dirjson -p
{
  "path": "test_dir/",
  "dirs": [
    {
      "path": "test_dir/test2",
      "dirs": [],
      "files": [
        {
          "name": "file.txt",
          "size": 4
        }
      ]
    }
  ],
  "files": [
    {
      "name": "hello.txt",
      "size": 5
    },
    {
      "name": "world.txt",
      "size": 5
    }
  ]
}
  • recursive scan of current and all subdirectories:
$ ./dirjson -r
  • output JSON result to the file
$ ./dirjson -o folder_structure.json

Contributing

I'm open for any contributions. If you found a bug, or have a new feature/refactoring proposal, docs fix etc. please, open an issue for discussions. Thank you! :)

License

MIT License. More info in LICENSE

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL