📌

【Pkl】設定ファイルを JSON に変換する

に公開

Pkl は設定を管理するためのプログラミング言語である。Kotlin で開発されている。mise でインストールしてみた

mise plugin add pkl
mise install pkl

pkl ファイルを用意する

intro.pkl
name = "Pkl: Configure your Systems in New Ways"
attendants = 100
isInteractive = true
amountLearned = 13.37

JSON に変換してみる

pkl eval -f json intro.pkl
{
  "name": "Pkl: Configure your Systems in New Ways",
  "attendants": 100,
  "isInteractive": true,
  "amountLearned": 13.37
}

Discussion