Brak opisu

Jonathan c493169bcd v1.2.3 4 lat temu
dist 9f635812c2 fix: changed default config location so it now works on deeper paths 5 lat temu
example 6a79ad8771 v1.2.3 4 lat temu
.gitignore 7c5f218d47 chore: initial release (v1.1.2) 5 lat temu
.npmignore 7c5f218d47 chore: initial release (v1.1.2) 5 lat temu
.snyk 8bfd67724e chore: added snyk 5 lat temu
README.md ad998ab9d9 v1.2.1: allowed use of callbacks if desired 5 lat temu
lofig.js 9f635812c2 fix: changed default config location so it now works on deeper paths 5 lat temu
package-lock.json 6a79ad8771 v1.2.3 4 lat temu
package.json 6a79ad8771 v1.2.3 4 lat temu
webpack.config.js 7971274c6d fix: updated webpack 5 lat temu

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.