Aucune description

Jonathan Graham ab1c40d423 Merge pull request #28 from jonathan-grah/dependabot/npm_and_yarn/webpack-5.76.0 il y a 2 ans
dist d4a03ae45a v1.3.3 il y a 4 ans
example e7021da795 feat: prevent config file from being fetched multiple times il y a 4 ans
.gitignore 7c5f218d47 chore: initial release (v1.1.2) il y a 5 ans
.npmignore 7c5f218d47 chore: initial release (v1.1.2) il y a 5 ans
README.md 3a19b12a0b Removed snyk reference il y a 4 ans
SECURITY.md c039c8f681 v1.3.1 il y a 4 ans
lofig.js 6374d59a20 v1.3.0 il y a 4 ans
package-lock.json 30ae8fe33e chore(deps-dev): bump webpack from 5.22.0 to 5.76.0 il y a 2 ans
package.json 55179807f8 chore(deps): bump node-forge and webpack-dev-server il y a 2 ans
webpack.config.js d4a03ae45a v1.3.3 il y a 4 ans

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.