No Description

Jonathan c493169bcd v1.2.3 4 years ago
dist 9f635812c2 fix: changed default config location so it now works on deeper paths 5 years ago
example 6a79ad8771 v1.2.3 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 ad998ab9d9 v1.2.1: allowed use of callbacks if desired 5 years ago
lofig.js 9f635812c2 fix: changed default config location so it now works on deeper paths 5 years ago
package-lock.json 6a79ad8771 v1.2.3 4 years ago
package.json 6a79ad8771 v1.2.3 4 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');

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

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

See the example folder for more details.