Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dynamic-config-store

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamic-config-store - npm Package Compare versions

Comparing version 1.0.5 to 1.1.0

12

package.json
{
"name": "dynamic-config-store",
"version": "1.0.5",
"version": "1.1.0",
"description": "Simple configuration utility for deployments and libraries",

@@ -46,4 +46,4 @@ "keywords": [

},
"dependencies": {
"immer": "^1.7.4",
"peerDependencies": {
"immer": "^3.1.1",
"lodash": "^4.17.11"

@@ -59,3 +59,3 @@ },

"typedoc": "^0.13.0",
"typescript": "^3.1.6",
"typescript": "^3.4.5",
"rollup": "^0.66.2",

@@ -66,4 +66,6 @@ "rollup-plugin-commonjs": "^9.1.8",

"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-typescript2": "^0.17.0"
"rollup-plugin-typescript2": "^0.17.0",
"immer": "^3.1.1",
"lodash": "^4.17.11"
}
}

@@ -182,10 +182,25 @@ ## 🔱 Dynamic Config Store

```
```typescript
const { serverSecret } = ServerConfig.getConfig({ ignoreOverrides: true });
```
## Config Reactions
## ✨ Config Reactions
### Deep Merging and Extending
Sometimes you need values in your config which are based off of other values. For this purpose you
can create reactions in the config which will play out after all other values have been set by whatever
means:
```typescript
config.addConfigChangeReaction((config) => {
if (!config.isProductionEnv) {
config.serverSecret = "dev_secret";
}
});
```
You don't need to return a value - simply change the current config directly. The great library [Immer](https://github.com/mweststrate/immer) is used under the covers to
allow this!
## Deep Merging and Extending
All of the methods in `dynamic-config-store` use **deep merging** when changing the config. This

@@ -192,0 +207,0 @@ ensures that your objects deeper in the config tree are not wholly over-written or cleared when you

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc