No Description

Jonathan 5bdbbf52c9 fix: bluebird isn't being used 5 years ago
dist 7971274c6d fix: updated webpack 5 years ago
example 7971274c6d fix: updated webpack 5 years ago
.gitignore 7c5f218d47 chore: initial release (v1.1.2) 5 years ago
.npmignore 7c5f218d47 chore: initial release (v1.1.2) 5 years ago
.snyk 8bfd67724e chore: added snyk 5 years ago
README.md c3a56f4e31 docs: added snyk badge 5 years ago
lofig.js 5bdbbf52c9 fix: bluebird isn't being used 5 years ago
package-lock.json 8bfd67724e chore: added snyk 5 years ago
package.json 5bdbbf52c9 fix: bluebird isn't being used 5 years ago
webpack.config.js 7971274c6d fix: updated webpack 5 years ago

README.md

lofig

npmjs.com/package/config for client side JavaScript

Known Vulnerabilities

Installation

npm install lofig --save --production

You can also use https://unpkg.com/lofig@latest/dist/lofig.min.js.

Usage

import 'lofig' from 'lofig'; // not necessary if using CDN Link

// change config folder
lofig.folder = 'config/default.json';

// check if property exists

await lofig.has('secret');
// OR
lofig.has('secret').then(res => {
	if (res) console.log("secret is defined!");
})

// return property

await lofig.get('secret');
// OR
lofig.get('secret').then(secret => {
	if (secret) console.log("secret:", secret);
})

See example folder for more details.