Repository
Current version released
5 years ago
Dependencies
deno.land/x
Versions
config
A deno module that helps you load configuration.
Usage
import { Config } from "https://raw.githubusercontent.com/eankeen/config/master/mod.ts"
const config = await Config.load({
file: 'fileName'
})
if (!config) {
console.log("config is 'undefined' when no config files were found")
}
// example including defaults
await Config.load({
file: 'fileName'
searchDir: Deno.cwd()
})
Options
file
the name of your filesearchDir
the directory to start searching. this is the directory that might include a.config
fileincludeDefault
, if loading a js/ts module, this determines if you want an object returned that includes thedefault
property (might be deprecatead soon)
Priority
The ordering is as follows. Modules are loaded from .config
folder first, then the parent to that folder. Rc files in .config
never start with a dot.
.config/file.config.ts
.config/file.config.js
.config/file.toml
.config/file.json
.config/file.yaml
.config/file.yml
file.config.ts
file.config.js
.file.toml
.file.json
.file.yaml
.file.yml