
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@octetstream/object-to-form-data
Advanced tools
Transform an object/collection to FormData. Good to use with then-busboy
serialize(object[, options]) -> {FormData}
true
, all false
boolean
values will be omitted.import serialize from "@octetstream/object-to-form-data"
const object = {
message: {
sender: "Glim Glam",
text: "Can you believe it, Trixie?",
attachments: [
{
file: File, // this field will be represented as a window.File instance
description: "I beat Twilight Sparkle and all I got was this lousy t-shirt."
}
]
}
}
const options = {
method: "post",
// You will receive a FormData instance with all fields of given object
body: serialize(object)
}
const response = await fetch("https://httpbin.org/post", options)
Important! If you're using this library in Node.js, you also need the formdata-node package to serialize your objects/collections. See documentation of this implementation to learn how to send queries with that implementation.
FAQs
Serialize objects, arrays and collections into FormData.
The npm package @octetstream/object-to-form-data receives a total of 957 weekly downloads. As such, @octetstream/object-to-form-data popularity was classified as not popular.
We found that @octetstream/object-to-form-data demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.