Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-form-data

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-form-data

A library to convert javascript objects into form data.

  • 1.1.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9K
decreased by-4.37%
Maintainers
1
Weekly downloads
 
Created
Source

json-form-data

A library to convert javascript objects into form data.

Build Status BrowserStack Status

Features

  • Supports CommonJS and AMD module loaders
  • Converts nested objects and arrays
  • Compatible with legacy web browsers
  • Supports all primitive data types
  • Supports File and FileList data types
  • Skips null and undefined values
  • Good unit test coverage

Usage

var testObject = {
    prop1: 'test',
    prop2: 2,
    prop3: null,
    prop4: undefined,
    prop5: true,
    prop6: false,
    prop7: new File(['file content'], 'my_file.txt'),
    prop8: {
        prop1: 'test',
        prop2: 2,
        prop3: null,
        prop4: undefined,
        prop5: true,
        prop6: false,
        prop7: [
            'test', 
            2, 
            null, 
            undefined, 
            true, 
            false
        ]
    }
};

var formData = window.jsonToFormData(testObject);

Browser Support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
IE10, IE11, Edgelatestlatestlatest

Sponsors

BrowserStack Logo

We use BrowserStack to automate our regression tests to ensure compatibility with supported browsers.

Keywords

FAQs

Package last updated on 21 Mar 2018

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