55
56

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

jo すごいよ jo

Last updated at Posted at 2016-03-10

mattn さんのツイートで知った jo が便利そうだったので速攻で導入しました。
これを使えば、CLI で JSON 文字列を生成するのがずいぶん楽になりそう!!
そして例によって AlpineLinuxDocker 化した(転送量: 5MB)ので
Docker さえ動いていればどんな環境でも使えます。

おもむろに .bash_profile やらにエイリアスを定義。

alias
echo 'alias jo="docker run --rm pottava/jo"' >> ~/.bash_profile
source ~/.bash_profile

これだけで jo れます

jo
jo -p $(env)
jo -p -a spring summer fall winter
jo time=$(date +%s) dir=$HOME

mattn さんのブログにあるコマンドもちゃんと通ります。

nested
$ jo -p name=JP object=$(jo fruit=Orange hungry@0 point=$(jo x=10 y=20) number=17) sunday@0
{
   "name": "JP",
   "object": {
      "fruit": "Orange",
      "hungry": false,
      "point": {
         "x": 10,
         "y": 20
      },
      "number": 17
   },
   "sunday": false
}

すごくよさそう〜

55
56
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
55
56

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?