Corn does away with special use-case data types, sticking only to the same small set available in JSON.
This simplifies parsing, makes your configuration versatile and avoids lock-in.
Corn has been designed using inspiration from JSON and Nix to produce a language that's easy and intuitive to write, good for config files, and has a feature-set small enough you can learn it in minutes. It was born out of the following frustrations:
let {
$entry = "dist/index.js"
$author = { name = "John Smith" email = "[email protected]" }
} in {
name = "example-package"
version = "1.0.0"
main = $entry
bin.filebrowser = $entry
private = false
author = $author
author.url = "https://example.com"
contributors = [ $author ]
scripts.build = "tsc"
scripts.run = "node dist"
dependencies = {
dotenv = "^8.2.0"
// put the rest of your deps here...
}
devDependencies.typescript = "^4.5"
config.port = 8080
config.hostname = null
}
Corn does away with special use-case data types, sticking only to the same small set available in JSON.
This simplifies parsing, makes your configuration versatile and avoids lock-in.
Each data type and feature has a single, simple, syntax that is valid, leaving no room for ambiguity.
The syntax is plain and predictable, borrowing from existing well-established languages.
Corn is designed to be read and written by humans. Use key-chaining to create deeply nested objects instantly, and inputs with merging to cut down on repetition.
Equally, the feature set has been kept purposefully minimal. This makes it easy to learn and get going within minutes.