Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.