Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
debug-promise
Advanced tools
Debug output outstanding promises, progress, errors, and resolution times.
debug-promise consumes promises and outputs logs showing their progress, their resolution or rejection, and makes state dumps showing all promises that have not settled.
debug-promise can consume any type of promises, but for the sake of this example we'll use one from Kriskowal's Q Library.
var Q = require('Q');
var debug = require('debug-promise')('test-logger');
var defer = Q.defer();
debug(defer.promise, 'arbitrary promise name for logging');
// sometime in the future resolve that promise
setTimeout(function () {
defer.resolve();
}, 10000);
debug-promise returns the original promise so you can easily chain like so:
debug(Q.resolve('value'), 'value promise').then(function (res) {
// res === 'value'
});
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 1 0 seconds
----------------------------
+0ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 1 0.002 seconds
arbitrary promise label 2 0.001 seconds
----------------------------
+3ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 1 0.003 seconds
arbitrary promise label 2 0.001 seconds
arbitrary promise label 3 0 seconds
----------------------------
+0ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 1 0.003 seconds
arbitrary promise label 2 0.001 seconds
arbitrary promise label 3 0 seconds
arbitrary promise label 4 0 seconds
----------------------------
+0ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 1 0.003 seconds
arbitrary promise label 2 0.001 seconds
arbitrary promise label 3 0 seconds
arbitrary promise label 4 0 seconds
arbitrary promise label 5 0.001 seconds
----------------------------
+1ms
debug-promise:test-logger progress (100): arbitrary promise label 1 0.004
+0ms
debug-promise:test-logger progress (undefined): arbitrary promise label 1 0.004
+1ms
debug-promise:test-logger resolved (undefined): arbitrary promise label 1 1.006
+1s
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 2 1.004 seconds
arbitrary promise label 3 1.003 seconds
arbitrary promise label 4 1.003 seconds
arbitrary promise label 5 1.003 seconds
----------------------------
+0ms
debug-promise:test-logger rejected (undefined): arbitrary promise label 2 2.007
+1s
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 3 2.006 seconds
arbitrary promise label 4 2.006 seconds
arbitrary promise label 5 2.006 seconds
----------------------------
+0ms
debug-promise:test-logger resolved (undefined): arbitrary promise label 3 3.001
+995ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 4 3.002 seconds
arbitrary promise label 5 3.002 seconds
----------------------------
+1ms
debug-promise:test-logger rejected ('asdf'): arbitrary promise label 4 4.001
+1s
debug-promise:test-logger rejected ('asdf'): arbitrary promise label 5 4.002
+0ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
arbitrary promise label 5 4.002 seconds
----------------------------
+0ms
debug-promise:test-logger
--- OUTSTANDING PROMISES ---
----------------------------
+0ms
FAQs
Debug output outstanding promises, progress, errors, and resolution times.
The npm package debug-promise receives a total of 0 weekly downloads. As such, debug-promise popularity was classified as not popular.
We found that debug-promise 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 malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.