Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
teeny-conf
Advanced tools
A small npm package to handle config files in Node apps. Works fine with Electron and NW.js
A small npm package to handle one or multiple config files in Node apps. Works well with Electron and NW.js.
All I/O operations are synchronous and write operation are atomic to avoid files corruption.
Saving and reloading are manual, in case you have to handle large files and avoid useless I/O operations.
I didn't find what I wanted on npm, I was needing a conf I could put in a variable, so I could export it without any problem to another scope.
npm install teeny-conf
config.js:
import teeny from 'teeny-conf';
const config = new teeny('config.json'));
conf.set('language', 'en');
conf.save(); // Save is a manual operation
config.js:
import teeny from 'teeny-conf';
const config = new teeny('config.json', {
some: {
nested: {
property: 42
}
}
}));
conf.get('some.nested.property'); // -> 42
config.js:
import teeny from 'teeny-conf';
const config = new teeny('config.json'));
export default config;
main.js
import config from './config.js';
// now you can use config.set(), config.get(), etc...
All key
in the docs refer to a usual key or a nested key.
new teeny(configPath[, defaultConfig])
configPath
String
the filename where you want your config / your config already is. If the directory/file does not exist, it will be created automatically.
defaultConfig
Object
the default configuration to use if the config file does not already exists.
A teeny
object.
teenyconf.get([key])
Get the key
value in your config. If no key
is specified, returns the whole conf.
Please note set
does not support sub-keys yet.
key
String (optional)
name of the key
any
teenyconf.set(key, value)
Set key
to value
.
key
String
name of the key
value
any
the new value for this key
teenyconf.has(key)
Check if a key exists in the conf.
key
String
name of the key
Boolean
teenyconf.delete(key)
Delete key
.
key
String
name of the key
teenyconf.clear()
Clear the conf and set it to empty object.
teenyconf.save([minify])
Save the current config into its associated file.
minify
Boolean
default to false
. Let you minify the content of the file
none
teenyconf.reload()
Reload the configuration from file. Can be useful if you have multiple instances of teeny-conf using the same file.
none
FAQs
A small npm package to handle config files in Node apps. Works fine with Electron and NW.js
The npm package teeny-conf receives a total of 19 weekly downloads. As such, teeny-conf popularity was classified as not popular.
We found that teeny-conf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.