
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
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 4 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.