Skip to content

optimized object configuration for human reading and typing

License

Notifications You must be signed in to change notification settings

mingqi/hoconfig-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

optimized object configuration for human reading and typing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published