hj

hoconfig-js

optimized object configuration for human reading and typing

Showing:

Popularity

Downloads/wk

161

GitHub Stars

2

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

2

Size (min+gzip)

12.0KB

License

Type Definitions

Tree-Shakeable

No?

Categories

Readme

hoconfig-js

Introduce

HOConfig (Human Optimized Config) keep the semantics from JSON, but make it more convenient as a human-editable config file format for reading and typing.

examples

# hoconfig is a json like configuration syntax, optimized for human reading and typing
# - support single line comment
# - omit root braces
# - the "," between member is optional

name : "Mingqi Shao",       # - string can be double quotation
title : 'engineer'          # - string can be single quotation. 
sex : male                  # - string even can no quotation
age : 33                    # - number will be auto detected
married : true              # - boolean as well
job : null                  # - support null. 
kids = 2                    # - key value separator can be = other than :
languanges : [
    java, ruby, clojure
    python, node.js]        # - this is Array
address :  {                # - this is recursive object
    country : china
    city : beijing
  }

singleQuotaString : 'this is "hoconfig" and escape \ is \'
doubleQuotaString : "this is 'hoconfig' and escape \ is \"

install

npm install hoconfig-js

use

var hoconfig = require('hoconfig-js')
config = hoconfig('/the/path/of/config')

the return value of hoconfig() is a object. hocnfig also accept string and buffer other than file path

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100