okapies / hoc2js

A command-line tool to convert Typesafe's HOCON to JSON

Home Page:https://github.com/typesafehub/config/blob/master/HOCON.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hoc2js

A command-line tool to convert HOCON to JSON. HOCON is JSON-like but is a config file format for supporting human usage, developed by Typesafe.

License

The license is Apache 2.0.

Requirement

  • Java 6 or later

Installation

Get an executable jar from release page.

$ curl -OL https://github.com/okapies/hoc2js/releases/download/v1.1/hoc2js-1.1.jar

Usage

Input a HOCON from stdin:

$ java -jar hoc2js-1.1.jar < test1.conf

hoc2js can have arguments to input multiple HOCON files (they will be merged, in order):

$ java -jar hoc2js-1.1.jar test1.conf test2.conf

The input HOCON may contain substitutions:

$ java -Dprop.test="hello" -jar hoc2js-1.1.jar
test = ${prop.test}
path = ${PATH}
^D
{"test":"hello","path":"/opt/local/bin:/opt/local/sbin:..."}

Configuration

You can override hoc2js's application.conf by specifying system properties.

$ java -Dhoc2js.render.formatted=true -jar hoc2js-1.1.jar

You can also use -Dconfig.resource=..., -Dconfig.file=..., or -Dconfig.url=.... to configure itself.

About

A command-line tool to convert Typesafe's HOCON to JSON

https://github.com/typesafehub/config/blob/master/HOCON.md

License:Apache License 2.0


Languages

Language:Java 100.0%