
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
formdata-to-string
Advanced tools
Transform a FormData instance into a raw string.
npm install --save formdata-to-string
This library is built up of internal methods from within Node's internal fetch
library, undici for transforming a FormData
instance into something that can be supplied in a fetch
request. The purpose of this is to silo the conversion and stream reading aspect of that process so that output can be used in other methods (eg. unit testing, code snippet generation, etc.).
import formDataToString from 'formdata-to-string';
// const { default: formDataToString } = require('formdata-to-string');
const form = new FormData();
form.append('dog', 'buster');
form.append('age', '18');
console.log(await formDataToString(form));
------formdata-undici-089527285518
Content-Disposition: form-data; name="dog"
buster
------formdata-undici-089527285518
Content-Disposition: form-data; name="age"
18
------formdata-undici-089527285518--
It also supports File
and Blob
objects that can be supplied to the FormData
API:
const form = new FormData();
const dataURL = 'data:image/png;name=owlbert.png;base64,iVBORw0KGgo...';
form.append('image', new Blob([dataURL], { type: 'image/png' }), 'owlbert.png');
console.log(await formDataToString(form));
------formdata-undici-075655755345
Content-Disposition: form-data; name="image"; filename="owlbert.png"
Content-Type: image/png
data:image/png;name=owlbert.png;base64,iVBORw0KGgo...
------formdata-undici-075655755345--
FAQs
Transform a FormData object into a raw string
The npm package formdata-to-string receives a total of 160 weekly downloads. As such, formdata-to-string popularity was classified as not popular.
We found that formdata-to-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.