2.0.2 • Published 2 years ago

github-to-json v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

GitHub to JSON

Generate JSON file of a repository structure using GitHub API.

Installation

  • Using npm

npm install --global github-to-json
  • Using yarn

yarn global add github-to-json
  • Using pnpm

pnpm install --global github-to-json

Usage

$ github-to-json <owner> <repo>

Options:
-d, --depth <depth> Depth upto which JSON is to be genrated

-t, --token <token> GitHub PAT

-o, --output <file> Output file name, by default the output is printed directly to the cli

Data Structure

The structure of genrated JSON is similar to the response of api.github.com/repos/aynp/resume/contents with exception of a contents property which recursively contains the contents of the directory.

  • Directory
{
  "name": "name",
  "path": "path",
  "sha": "sha",
  "size": 0,
  "url": "dir_url",
  "html_url": "html_url",
  "git_url": "git_url",
  "download_url": null,
  "type": "dir",
  "_links": {
    "self": "self_url",
    "git": "git_url",
    "html": "html_url"
  }
  "contents": [
    {}
  ]
}
  • File
{
  "name": "name",
  "path": "path",
  "sha": "sha",
  "size": 1234,
  "url": "file_url",
  "html_url": "html_url",
  "git_url": "git_url",
  "download_url": "download_url",
  "type": "file",
  "_links": {
    "self": "self_url",
    "git": "git_url",
    "html": "html_url"
  }
}
1.0.2

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago