
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
context-manager
Advanced tools
Manage context for templates.
npm i context-manager --save
var context = require('context-manager');
Create an instance of Context.
Add a context level, optionally passing a value to start with.
name {String}: The name of the context to add.level {Number}: Numerical value representing the order in which this level should be merged versus other lvl.value {Object}: Optionally pass an object to start with.context.setContext('locals', {a: 'b'});
Get the raw (un-merged) context for name.
name {String}: The context to get.returns: {*}context.setContext('a', {a: 'b'});
context.getContext('a');
// => {a: 'b'}
Extend context name with the given value
name {String}key {String}value {Object}returns: {String}context.setContext('locals', {a: 'b'});
Set the level for a context. This determines the order in which the context will be merged when .calculate() is called.
name {String}: The name of the context.level {Number}: The level (number) to set for the level.if (foo) {
context.setLevel('locals', 10);
} else {
context.setLevel('locals', 0);
}
Calculate the context, optionally passing a callback fn for sorting. (Note that sorting must be done on levels, not on the context names).
keys {String|Array}: Key, or array of keys for context levels to include.fn {Function}: Sort function for determining the order of merging.app.calculate(['a', 'b'], function(a, b) {
return app.lvl[a] - app.lvl[a];
});
Clear all contexts.
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert
Released under the license
This file was generated by verb on February 21, 2015.
FAQs
Manage context for templates.
The npm package context-manager receives a total of 2 weekly downloads. As such, context-manager popularity was classified as not popular.
We found that context-manager 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.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.