
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
form-data-kit
Advanced tools
library to parse, stringify, and expand FormData
npm install form-data-kit
import { parse, stringify, expand } from 'form-data-kit';
parse(query: string): FormData
stringify(formData: FormData): string
expand(formData: FormData): object
Parse takes a search param / query string, like the one from an url, and returns FormData
import { parse } from "form-data-kit";
parse("one=foo&two=bar");
// FormData {
// [Symbol(state)]: [ { name: 'one', value: 'foo' }, { name: 'two', value: 'bar' } ]
// }
Parse takes FormData, and returns a search param / query string
import { stringify } from "form-data-kit";
const formData = new FormData();
formData.set("one", "foo");
formData.set("two", "bar");
stringify(formData);
// one=foo&two=bar
Expands formData into an object. This method supports nesting, using .
and [number]
syntax.
import { expand } from "form-data-kit";
const formData = new FormData();
formData.append("one", "1");
formData.append("two", "2");
formData.append("nested.three", "3");
formData.append("array[0]", "4");
formData.append("array[1].five", "5");
expand(formData);
// {
// one: '1',
// two: '2',
// nested: {
// three: '3',
// },
// array: ['4', { five: '5' }],
// }
FAQs
a lib to parse, stringify, and expand FormData
The npm package form-data-kit receives a total of 207 weekly downloads. As such, form-data-kit popularity was classified as not popular.
We found that form-data-kit 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
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.