Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@geek/config
Advanced tools
Geek Configuration Manager for Node.js - The complete solution for managing config settings for your Node.js application
Geek Configuration Manager for Node.js - The complete solution for managing config settings for your Node.js application
Install
@geek/config
npm install @geek/config
const Config = require('@geek/config');
// single profile
const config1 = new Config({
cwd: __dirname,
name: 'myapp',
profile: 'dev',
overrides: { property2: 'override-value' },
defaults: { property9: 'default-value' },
});
// multiple profiles
const config2 = new Config({
cwd: __dirname,
name: 'myapp',
profiles: [ 'dev', 'ios' ],
overrides: { property2: 'override-value' },
defaults: { property9: 'default-value' },
});
priority | source | example | location |
---|---|---|---|
1. | process.env | MYAPP_PROPERTY1="environment-value" | environment variable |
2. | overrides | { "property1": "override-value" } | parameter: overrides |
4. | files | ['~/.titanium/config.json', '~/.tn.json'] | parameter: files |
5. | user profile config file | myapp.dev.user.json | project directory |
6. | user config file | myapp.user.json | project directory |
7. | project profile config file | myapp.dev.project.json | project directory |
8. | project config file | myapp.project.json | project directory |
9. | global profile config file | myapp.dev.global.json | home config directory |
10. | global config file | myapp.global.json | home config directory |
11. | system config file | myapp.system.json | home config directory |
12. | default values | { "property1": "default-value" } | parameter: defaults |
NOTE: Currently only the file extension
.json
is supported. Support for more file extensions will be added very soon.
cost Config = require('@geek/config');
const config = new Config({ name: 'myapp' });
process.env variables
(if exists)Loaded objects fromm all the manually entered filenames:
files
(from parameter )One of the following:
myapp.user.json5
(if exists)myapp.user.yaml
(if exists)myapp.user.yml
(if exists)myapp.user.json
(if exists)One of the following:
myapp.project.json5
(if exists)myapp.project.yaml
(if exists)myapp.project.yml
(if exists)myapp.project.json
(if exists)One of the following:
~/.myapp/global.json5
(if exists)~/.myapp/global.yaml
(if exists)~/.myapp/global.yml
(if exists)~/.myapp/global.json
(if exists)One of the following:
~/.myapp/system.json5
(if exists)~/.myapp/system.yaml
(if exists)~/.myapp/system.yml
(if exists)~/.myapp/system.json
(if exists)name, overrides, defaults
cost Config = require('@geek/config');
const config = new Config({ name: 'myapp', overrides: { variable2: 'overrides' }, defaults: variable9: 'defaults' });
process.env variables
(if exists)overrides
(from parameter)Loaded objects fromm all the manually entered filenames:
files
(from parameter )One of the following:
myapp.user.json5
(if exists)myapp.user.yaml
(if exists)myapp.user.yml
(if exists)myapp.user.json
(if exists)One of the following:
myapp.project.json5
(if exists)myapp.project.yaml
(if exists)myapp.project.yml
(if exists)myapp.project.json
(if exists)One of the following:
~/.myapp/global.json5
(if exists)~/.myapp/global.yaml
(if exists)~/.myapp/global.yml
(if exists)~/.myapp/global.json
(if exists)One of the following:
~/.myapp/system.json5
(if exists)~/.myapp/system.yaml
(if exists)~/.myapp/system.yml
(if exists)~/.myapp/system.json
(if exists)default values
defaults
(from parameter)if passed in environment only:
--profile dev
if passed in:
--local-only
if passed in specific config file:
--config mytest.json
(with no environment specified)
if passed in specific config file:
--config mytest.json --profile dev
if passed in:
--only mytest.json
Have an idea or a comment? Join in the conversation here!
FAQs
Geek Configuration Manager for Node.js - The complete solution for managing config settings for your Node.js application
The npm package @geek/config receives a total of 9 weekly downloads. As such, @geek/config popularity was classified as not popular.
We found that @geek/config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.