Sem descrição

Jonathan Graham e07c26e087 Merge pull request #13 from jonathan-grah/dependabot/npm_and_yarn/path-parse-1.0.7 há 3 anos atrás
dist d4a03ae45a v1.3.3 há 4 anos atrás
example e7021da795 feat: prevent config file from being fetched multiple times há 4 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
README.md 3a19b12a0b Removed snyk reference há 4 anos atrás
SECURITY.md c039c8f681 v1.3.1 há 4 anos atrás
lofig.js 6374d59a20 v1.3.0 há 4 anos atrás
package-lock.json e07c26e087 Merge pull request #13 from jonathan-grah/dependabot/npm_and_yarn/path-parse-1.0.7 há 3 anos atrás
package.json f30b093c0e v1.3.4 há 4 anos atrás
webpack.config.js d4a03ae45a v1.3.3 há 4 anos atrás

README.md

lofig

npmjs.com/package/config, but for client side JavaScript

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.