@lumjs/dotjs
v1.0.0
Published
A minimalistic library for using JS configuration files, along with defaults passed as objects.
Readme
lum.dotjs.js
A minimalistic library for using JS configuration files, along with defaults passed as objects.
Supports both ESM and CommonJS module formats.
Examples
First off import the library. If using ES Modules:
import dotjs from '@lumjs/dotjs';Or if using CommonJS:
const dotjs = require('@lumjs/dotjs');Now that it's loaded, the sytax is the same.
const DEFAULT_OPTS = {someOption: true, anotherOption: false};
const config = await dotjs(DEFAULT_OPTS, 'config.defaults.js', 'config.js');It will ignore any files that don't exist. Also, all file paths are relative to the current working directory, so keep that in mind.
Official URLs
This library can be found in two places:
Author
Timothy Totten [email protected]
