Socket
Socket
Sign inDemoInstall

append-field

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

append-field

A [W3C HTML JSON forms spec](http://www.w3.org/TR/html-json-forms/) compliant field appender (for lack of a better name). Useful for people implementing `application/x-www-form-urlencoded` and `multipart/form-data` parsers.


Version published
Weekly downloads
5.3M
increased by6.67%
Maintainers
1
Weekly downloads
 
Created

What is append-field?

The append-field npm package is designed to facilitate the manipulation of form data, specifically for appending fields to an existing FormData instance. It is particularly useful in scenarios where you need to dynamically add fields to FormData before submitting it, such as in file uploads or when dealing with complex form structures.

What are append-field's main functionalities?

Appending fields to FormData

This feature allows you to append a new field to an existing FormData object. The code sample demonstrates how to append a simple key-value pair to FormData.

const appendField = require('append-field');
let formData = new FormData();
appendField(formData, 'key', 'value');

Appending nested fields to FormData

This feature enables appending nested fields to FormData, which is useful for representing complex data structures. The code sample shows how to append nested fields to represent a user's name and email.

const appendField = require('append-field');
let formData = new FormData();
appendField(formData, 'user[name]', 'John Doe');
appendField(formData, 'user[email]', 'john@example.com');

Other packages similar to append-field

FAQs

Package last updated on 24 Jul 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc