
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
ExpressJS middleware. Send response containing data. Format in JSON
, XML
, csv
, xlsx
, html
, and text
.
$ npm install sendme
var sendme = require('sendme');
app.use(sendme(config)); // Attaches sendme(data) to res.
app.use(function(req, res) {
var json;
// Do work.
res.sendme(json);
});
config
(optional) is a JSON object containing formatting configurations. The config
is passed to the delimit()
function in tabular-json. Pass format-specific options using a sub-object (e.g. as {xlsx: {includeHeaders: false}}
), and non-specific options to the base config
object.
var config = {
includeHeaders: false,
sort: ['id'],
txt: {
separator: ';',
stringWrap: '"'
}
};
See tabular-json for more details on config options
sendme will send the response in various formats. Either specify a content type using the Accept
header, or append a format extension to the end of the req.path
. A format extension will always override the Accept
header.
.json
- Content-Types: application/json
application/json
is the primary response type..xml
- Content-Types: application/xml
, text/xml
.xlsx
- Content-Types: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.csv
- Content-Types: application/csv
.html
- Content-Types: text/html
.txt
- Content-Types: text/plain
Specify a format in the url path:
GET /foos/1.xml HTTP/1.1
Host: example.com
var data = {
id: 1,
type: 'widget'
};
res.sendme(data);
Response:
HTTP/1.0 200 OK
Content-Type: text/xml
<?xml version="1.0" encoding="UTF-8" ?>
<data>
<id>1</id>
<type>widget</type>
</data>
Also, specify a format in the Accept
parameter:
GET /foos HTTP/1.1
Host: example.com
Accept: application/csv
Response:
HTTP/1.0 200 OK
Content-Type: application/csv
"id","type"
1,"widget"
2,"gadget"
FAQs
Express middleware used to convert json and res.send in multiple formats
The npm package sendme receives a total of 0 weekly downloads. As such, sendme popularity was classified as not popular.
We found that sendme 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.