
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Minimalist utilities for backend services.
NOTE: Version
0.4.0
and above uses ESM module (i.e.,type: module
) only.
Provides a BaseLog
class with a LogWriter
driver architecture.
import {BaseLog, LogWriter} from 'backlib';
interface WebLogRecord {
...
}
class WebLog extends BaseLog<WebLogRecord>{
constructor() {
const writers: LogWriter<WebLogRecord>[] = [];
const baseName = 'web_log';
// Add custom writer using redstream (Redis Stream) for realtime login
const logStream = getWebLogStream(); // not provided
writers.push({
name: baseName + '_stream',
writeRec: async (rec: WebLogRecord) => {
await logStream.xadd(rec);
}
});
super({ writers });
}
}
const _webLog = new WebLog(); // must be after ServiceLog definition
export webLog(rec: WebLogRecord){
_webLog.log(rec);
}
Know if a decorator method is at the leaf
of the class tree. Usefull when want to apply logic one one per method name.
// One per decorator
const leafTracer = newLeafTracer();
export function MethodDec() {
return function (target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) {
// original method
const method = descriptor.value!;
descriptor.value = async function methodDecWrapper() {
// must be called on each invocation (because of order of Decoration eval at init time).
// However, flag is cache, so fast check.
const isLeaf = leafTracer.trace(this.constructor, target.constructor, propertyKey);
if (isLeaf){
// here logic to be apply only for the top most method for a given name for this class inheritance tree
}
const result = method.apply(this,arguments);// exec and get result
if (isLeaf){
// eventual logic post execution
}
return result;
}
}
}
FAQs
Minimalist library for backend services
The npm package backlib receives a total of 5 weekly downloads. As such, backlib popularity was classified as not popular.
We found that backlib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.