jkit

command module
v0.0.0-...-4c941a2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 7 Imported by: 0

README

🔧 jkit Go

JSON CLI Tool

Install

git clone https://github.com/wuhan005/jkit.git
cd jkit
go install

Usage

Copy your JSON first, then enjoy it.


jkit f Format JSON

Input JSON

> jkit f

{
    "data": {
        "area": "东京Amazon数据中心",
        "country": "日本",
        "ip": "52.68.96.58"
    },
    "error": 0,
    "msg": "success"
}
jkit c <deep> Fold JSON

Input JSON

> jkit c 4

{
    "code": 0.000000,
    "message": "success",
    "result": {
        "main_section": {
            "type": 0.000000,
            "episodes": [
                { 14 items dict },
                { 14 items dict },
                { 14 items dict },
                { 14 items dict },
                { 14 items dict },
            ],
            "id": 49914.000000,
            "title": "正片"
        },
        "section": [
            {
                "id": 50112.000000,
                "title": "PV",
                "type": 2.000000,
                "episodes": [ 3 items array ]
            }
        ]
    }
}
jkit g Get JSON element

Input JSON

> jkit g result.main_section.episodes.0

{
    "badge": "会员",
    "badge_info": {
        "bg_color": "#FB7299",
        "bg_color_night": "#BB5B76",
        "text": "会员"
    },
    "cover": "http://i0.hdslb.com/bfs/archive/34a44b83a9c657a9d096d85771334f545e32dd17.jpg",
    "from": "bangumi",
    "id": 341208,
    "is_premiere": 0,
    "status": 13,
    "title": "1",
    "vid": "",
    "badge_type": 0,
    "long_title": "见习魔女伊蕾娜",
    "aid": 329827456,
    "cid": 281989571,
    "share_url": "https://www.bilibili.com/bangumi/play/ep341208"
}
jkit m Generate JSON form list

Input from my GitHub profile README:

> jkit m

[
    "Hi, I'm E99p1ant. 🍆",
    "🐭 Focus on Golang.",
    "🏠 Blog at github.red.",
    "💬 Ask me something?",
    "🤤 Buy me a cup of coffee.",
    "Some cool gadgets I made:",
    "",
    "NekoBox - 匿名提问箱 / Anonymous Question Box",
    "Apicon - API 热爱者"
]

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