Skip to content

supernovus/lum.dotjs.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 2010@totten.ca

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published