1.0.2 • Published 4 years ago

to-formdata v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

to-formdata

A library to convert Object/Array to form-data streams.

Support

This library is supported by any JavaScript platforms

Install

Install using npm

npm install --save to-formdata

Install using yarn

yarn add to-formdata

Usage

How to use

const toFormData=require('to-formdata')

Examples

const toFormData= require('to-formdata')

const file = new File(["foo"],"foo.txt",{
    type:"text/plain"
});

const data = {
    name: "foo",
    gender: "Male",
    image: file
};

const converted = toFormData(data);

ES6

import toFormData from 'to-formdata


const file = new File(["foo"],"foo.txt",{
    type:"text/plain"
});

const data = {
    name: "foo",
    gender: "Male",
    image: file
};

const converted = toFormData(data);