
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
express-dump-curl
Advanced tools
ExpressJS middleware to dump received requests as curls and RESTests
This ExpressJS middleware dumps the equivalent curl command of the request received.
The curl dump can be written in standard output or on a specific file and it is generally very well formatted to ease both reading and editing.
Install the package by running one of the following commands, depending on your configuration:
npm install --save express-dump-curl
yarn add express-dump-curl
const fs = require ( 'fs' );
const express = require ( 'express' );
// Include express-dump-curl as a dependency
const dump_curl = require ( 'express-dump-curl' ).dump_curl;
const app = express ();
...
app.use ( bodyParser.json() );
app.use ( multiplart() );
...
// There are two parameters you can pass at the `dump_curl()` middleware:
//
// dump_curl ( output_file, force_https )
//
// - output_file - a complete filepath where to save the curls.
// if the path is not specified, stdout will be used.
//
// - force_https - a flag T/F. If true, the protocol of the CURL will always
// be "https" reguardless of the real protocol used.
// Include the express dump curl middleware
// if no filename is specified in the call, console.log will be
// used to dump curls
app.use ( dump_curl () );
// Alternatively, you can specify a filename in dump_curl definition
// app.use ( dump_curl ( "/ramdisk/curls.txt" ) );
...
app.use('/auth', authRouter);
app.use('/users', usersRouter);
From now on, every single call will be logged on console or file depending on your configuration.
There are two parameters you can pass at the dump_curl() middleware:
dump_curl ( output_file, force_https )
output_file - a complete filepath where to save the curls.
if the path is not specified, stdout will be used.
force_https - a flag T/F. If true, the protocol of the CURL will always
be "https" reguardless of the real protocol used.
You can do even more with this module, in fact there are two extra methods you can use in your software.
dump_restest ( output_file, force_https )
Is identical to dump_curl() but it dumps a JSON in RESTest format (the RESTest application has not been delivered yet).
curl_str ( force_https ) returns a string with the CURL. The method is the same used inside dump_curl()
FAQs
ExpressJS middleware to dump received requests as curls and RESTests
The npm package express-dump-curl receives a total of 7 weekly downloads. As such, express-dump-curl popularity was classified as not popular.
We found that express-dump-curl 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.