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.
request-capture-har
Advanced tools
Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client
Wrapper for
request
module that saves all network traffic data as a HAR file.
Compatibility
request >= 2.81.0 recommended, as it has much more detailed timings via timingPhases
.
request >= v2.75.0 required, at a minimum.
// wrap around your request module
const RCH = require('request-capture-har');
const requestCaptureHar = new RCH(require('request'));
// ...
// `requestCaptureHar.request` is your `request` module's API.
// ...
requestCaptureHar.request(uri, options, callback);
// Save HAR file to disk
requestCaptureHar.saveHar(`network-waterfall_${new Date().toISOString()}.har`);
// You can also clear any collected traffic
requestCaptureHar.clearHar();
This repo is a fork of larsthorup's node-request-har-capture
. Instead of monkey-patching request-promise
, the API allows you to pass in the general request
module. We also added better support for transfer timings.
Above is a HAR captured by using request-capture-har
from within npm
to capture an npm install
.
This is especially useful for capturing all test traffic from your back-end test suite, for doing auto mocking in your front-end test suite. See this project for an example: https://github.com/larsthorup/http-auto-mock-demo. Blog post about this technique: http://www.zealake.com/2015/01/05/unit-test-your-service-integration-layer/
FAQs
Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client
The npm package request-capture-har receives a total of 1,195 weekly downloads. As such, request-capture-har popularity was classified as popular.
We found that request-capture-har 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.