to-formdata

1.0.2 • Public • Published

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);

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i to-formdata

      Weekly Downloads

      77

      Version

      1.0.2

      License

      ISC

      Unpacked Size

      2.54 kB

      Total Files

      3

      Last publish

      Collaborators

      • ramyaiyer15