Sem descrição

dependabot[bot] a4d78d0283 chore(deps): bump https-proxy-agent from 2.2.2 to 2.2.4 há 5 anos atrás
dist 9f635812c2 fix: changed default config location so it now works on deeper paths há 5 anos atrás
example ad998ab9d9 v1.2.1: allowed use of callbacks if desired há 5 anos atrás
.gitignore 7c5f218d47 chore: initial release (v1.1.2) há 5 anos atrás
.npmignore 7c5f218d47 chore: initial release (v1.1.2) há 5 anos atrás
.snyk 8bfd67724e chore: added snyk há 5 anos atrás
README.md ad998ab9d9 v1.2.1: allowed use of callbacks if desired há 5 anos atrás
lofig.js 9f635812c2 fix: changed default config location so it now works on deeper paths há 5 anos atrás
package-lock.json a4d78d0283 chore(deps): bump https-proxy-agent from 2.2.2 to 2.2.4 há 5 anos atrás
package.json 9f635812c2 fix: changed default config location so it now works on deeper paths há 5 anos atrás
webpack.config.js 7971274c6d fix: updated webpack há 5 anos atrás

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.