No Description

Jonathan Graham ab1c40d423 Merge pull request #28 from jonathan-grah/dependabot/npm_and_yarn/webpack-5.76.0 2 years ago
dist d4a03ae45a v1.3.3 4 years ago
example e7021da795 feat: prevent config file from being fetched multiple times 4 years ago
.gitignore 7c5f218d47 chore: initial release (v1.1.2) 5 years ago
.npmignore 7c5f218d47 chore: initial release (v1.1.2) 5 years ago
README.md 3a19b12a0b Removed snyk reference 4 years ago
SECURITY.md c039c8f681 v1.3.1 4 years ago
lofig.js 6374d59a20 v1.3.0 4 years ago
package-lock.json 30ae8fe33e chore(deps-dev): bump webpack from 5.22.0 to 5.76.0 2 years ago
package.json 55179807f8 chore(deps): bump node-forge and webpack-dev-server 2 years ago
webpack.config.js d4a03ae45a v1.3.3 4 years ago

README.md

lofig

npmjs.com/package/config, but for client side JavaScript

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');

// return property
await lofig.get('secret');

// NOTE: You can also use callbacks e.g.
lofig.get('secret', res => {
	console.log('secret', res);
})

Development

Run npm run dev to use webpack-dev-server for development purposes.