Socket
Socket
Sign inDemoInstall

@types/form-data

Package Overview
Dependencies
1
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/form-data

TypeScript definitions for form-data


Version published
Weekly downloads
1.1M
increased by4.72%
Maintainers
1
Created
Weekly downloads
 

Package description

What is @types/form-data?

@types/form-data provides TypeScript type definitions for the form-data library, which is used to create and manipulate form data, especially for HTTP requests. It allows developers to handle form data in a type-safe manner.

What are @types/form-data's main functionalities?

Creating Form Data

This feature allows you to create a new FormData instance and append key-value pairs to it. This is useful for constructing form data to be sent in HTTP requests.

const FormData = require('form-data');
const form = new FormData();
form.append('my_field', 'my_value');

Appending Files

This feature allows you to append files to the form data. This is particularly useful for file upload scenarios where you need to send files as part of an HTTP request.

const fs = require('fs');
const FormData = require('form-data');
const form = new FormData();
form.append('file', fs.createReadStream('/path/to/file'));

Setting Headers

This feature allows you to get the headers that should be included in the HTTP request when sending the form data. This is important for ensuring that the server correctly interprets the form data.

const FormData = require('form-data');
const form = new FormData();
const headers = form.getHeaders();

Other packages similar to @types/form-data

Readme

Source

Installation

npm install --save @types/form-data

Summary

This package contains type definitions for form-data (https://github.com/form-data/form-data).

Details

Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/form-data

Additional Details

  • Last updated: Wed, 08 Nov 2017 22:42:24 GMT
  • Dependencies: stream, http, node
  • Global values: none

Credits

These definitions were written by Carlos Ballesteros Velasco https://github.com/soywiz, Leon Yu https://github.com/leonyu, BendingBender https://github.com/BendingBender.

FAQs

Package last updated on 08 Nov 2017

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc