
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
promise-log
Advanced tools
I don't know about you, but I'm tired of typing stuff like this while debugging my node libraries (specially when working in the REPL!):
somePromiseReturningFunction(args).then(console.log).catch((e) => console.log(e.stack))
Instead, I'd like to do this:
somePromiseReturningFunction(args).log();
Or even, in longer processing chains:
myPromise
.then(doStuff)
.then(someWeirdProcessingStuff)
.then(function (value) {
console.log('partial value is:', value);
return value;
})
.then(doMoreStuff);
Becomes:
myPromise
.then(doStuff)
.then(someWeirdProcessingStuff)
.log('partial value is:')
.then(doMoreStuff);
Hence, I published the promise-log
module to better support my laziness.
Install with npm:
npm install promise-log
And require anywhere in your project, passing the promise prototype you want to extend
(defaults to native Promise
):
require('promise-log')(Promise);
That will add the log
method to the Promise prototype.
FAQs
shortcut for console.loggin' your promises
We found that promise-log 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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.