ejson is a new markup language by ls.
It's easily, light and quickly.
ExampleTest/main.ejson
:
hello : hello
# This is a line of comments
# hello is a string
world : "world"
# of course, u can also use " to represent a string
array : @Test/array.ejson
# include a file as var array
ExampleTest/array.ejson
:
hello
"world"
Script exampleTest/index.ls
:
{ ejson } = require "../ejson"
# Test Parse
json = ejson.toJSON "./Test/main.ejson", 0, 4
# u can use ejson.parse to parse ejson to js object
console.log json
# Test stringify
ejson.stringify { json : json }, "./Test/testout.ejson"
run :
{
"hello": "hello",
"world": "world",
"array": [
"hello",
"world"
]
}