Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Adds context to objects. Good for contextual logging.
Decorates obj
with a context. pushctx
or popctx
will extende context.
var ctxobj = require('ctxobj');
// just an object
var obj0 = { x: 1, y: { val: 2 } };
// decorate with context
var obj1 = ctxobj.new(obj0);
// push and pop data to the context
obj1.pushctx('c1')
obj1.pushctx('c2a').pushctx('c2b')
obj1.popctx().popctx();
// enumarate contexts
obj1.forEachCtx(function(c) {
console.log(c);
});
Output:
c1
Decorates console-like objects with a context that is prepended to each console.xxx()
call.
var ctxobj = require('ctxobj');
var log0 = ctxobj.console(console);
log0.info('no context yet');
var i = 0;
var log1 = log0.pushctx('c1').pushctx(function() { return i++; });
log1.warn('now with a two items in the context');
log1.info('yo yo yo');
var log2 = log1.popctx();
log2.error('only one item in the context now');
Output:
no context yet
[c1][0] now with a two items in the context
[c1][1] yo yo yo
[c1] only one item in the context now
Some sugar:
Pushes a timestamp function to the context
Pushes file name and line number of log line to the context (skipping skip
frames).
MIT
FAQs
Objects with context, especially good for contextual logging
The npm package ctxobj receives a total of 401 weekly downloads. As such, ctxobj popularity was classified as not popular.
We found that ctxobj 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.