Sen descrición

Jonathan 6374d59a20 v1.3.0 %!s(int64=4) %!d(string=hai) anos
dist e7021da795 feat: prevent config file from being fetched multiple times %!s(int64=4) %!d(string=hai) anos
example e7021da795 feat: prevent config file from being fetched multiple times %!s(int64=4) %!d(string=hai) anos
.gitignore 7c5f218d47 chore: initial release (v1.1.2) %!s(int64=5) %!d(string=hai) anos
.npmignore 7c5f218d47 chore: initial release (v1.1.2) %!s(int64=5) %!d(string=hai) anos
.snyk 8bfd67724e chore: added snyk %!s(int64=5) %!d(string=hai) anos
README.md e7021da795 feat: prevent config file from being fetched multiple times %!s(int64=4) %!d(string=hai) anos
lofig.js 6374d59a20 v1.3.0 %!s(int64=4) %!d(string=hai) anos
package-lock.json 6374d59a20 v1.3.0 %!s(int64=4) %!d(string=hai) anos
package.json 6374d59a20 v1.3.0 %!s(int64=4) %!d(string=hai) anos
webpack.config.js e7021da795 feat: prevent config file from being fetched multiple times %!s(int64=4) %!d(string=hai) anos

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.