1.0.3 • Published 2 years ago

tc-config v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Syntax

config "<name>" {
	<type> <name> <value>
}

Example

config.tc:

config "main" {
	boolean yes true
    boolean no false
    number zero 0
    number one 1
    string test TEST
    string test1 TEST1
}

index.js:

const { readFileSync } = require("fs")
const { parse } = require("tc-config")
const config = readFileSync("./config.tc", "utf8")
parse(config) // { name: "main", properties: { yes: true, no: false, zero: 0, one: 1, test: "TEST", test1: "TEST1"} }

Types

the available types are string, number, boolean, json

json

config "main" {
	json what {"yes":"yes","no":"no"}
}

environment variables

you can access environment variables by using {NAME}

example

config "main" {
	string test The environment variable named lol is {lol}
}
1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago