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

@ajoelp/json-to-formdata

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ajoelp/json-to-formdata

Convert json data to a FormData object

  • 1.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

JSON to FormData

Convert json data to a FormData object

Install

This project uses node. Install from their website

$ npm i @ajoelp/json-to-formdata

Usage

// Using ES6
import jsonToFormData from '@ajoelp/json-to-formdata';

// Using CommonJS
const jsonToFormData = require('@ajoelp/json-to-formdata');

// Use the package
const formData = jsonToFormData({
  foo: 'bar',
  bar: 'baz',
});

// With options
const formData = jsonToFormData({
  foo: 'bar',
  bar: 'baz',
}, {
  // Add indexes to arrays
  arrayIndexes: true,
  // Exclude nulls from data items
  excludeNull: true,
});

// Append an existing FormData Object
const formData = new FormData();
formData.append('key', 'value');

jsonToFormData({
  foo: 'bar',
  bar: 'baz',
}, {}, formData);

License

MIT License © Joel Podrebarac

Keywords

FAQs

Package last updated on 20 Mar 2023

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