![Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility](https://cdn.sanity.io/images/cgdhsj6q/production/97774ea8c88cc8f4bed2766c31994ebc38116948-1664x1366.png?w=400&fit=max&auto=format)
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
context-config
Advanced tools
get(key)
requests to elements of that array. It allows notifying users about changes in configs using 'change' event on EventEmitter.Function | Description |
---|---|
ConfigurationBuilder | |
require('context-config').ConfigurationBuilder | importing the constructor |
new ConfigurationBuilder(emitter) | constructor accepts an EventEmitter and will emit 'config-read' event when new config is read |
build(context, ref) | ref object lists properties of the app whose configs we want to load (can contain properties domain, target, project, config, and version). Returns a promise. |
create a new instance of ConfigurationBuilder
var ConfigurationBuilder = require('context-config').ConfigurationBuilder;
var builder = new ConfigurationBuilder(emitter);
call build method to load the config which in turn returns a promise.
builder.build(context, ref)
.then(function(config){
// use the config
console.log(config.get('key'));
})
.fail(function(error){
// handle the error
console.log(error.stack);
})
.done();
create a new instance of ContextConfiguration
var ContextConfiguration = require('context-config').ContextConfiguration;
var config = new ContextConfiguration([],[]);
append new values to the config
// without context
config.append({
"key":"k1",
"value":"v1"
});
// with context
config.append({
"key":"k1",
"context": {"site":"en-US"},
"value":"v2"
});
get values using a key
// without a context
config.get("k1"); // should return "v1"
// with a context
config.get("k1", [{"site":"en-US"}]); // should return "v2"
FAQs
context-config-node ===================
The npm package context-config receives a total of 1 weekly downloads. As such, context-config popularity was classified as not popular.
We found that context-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.