No Description

Jonathan 085c34fa1b v1.3.1 4 years ago
dist c039c8f681 v1.3.1 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
.snyk 8bfd67724e chore: added snyk 5 years ago
README.md e7021da795 feat: prevent config file from being fetched multiple times 4 years ago
SECURITY.md c039c8f681 v1.3.1 4 years ago
lofig.js 6374d59a20 v1.3.0 4 years ago
package-lock.json 6374d59a20 v1.3.0 4 years ago
package.json 6374d59a20 v1.3.0 4 years ago
webpack.config.js e7021da795 feat: prevent config file from being fetched multiple times 4 years ago

README.md

lofig

npmjs.com/package/config, but 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');

// 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.