Socket
Socket
Sign inDemoInstall

isomorphic-form-data

Package Overview
Dependencies
6
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    isomorphic-form-data

A library to create readable "multipart/form-data" in node and the browser.


Version published
Weekly downloads
160K
increased by3.16%
Maintainers
1
Install size
304 kB
Created
Weekly downloads
 

Readme

Source

A library to create readable "multipart/form-data" isomorphically in node and the browser.

Install

npm install isomorphic-form-data

Usage

In this example we are constructing a form with 3 fields that contain a string, a buffer and a file stream.

require('isomorphic-form-data');
var fs = require('fs');

var form = new FormData();
form.append('my_field', 'my value');
form.append('my_buffer', new Buffer(10));
form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
node-fetch

You can submit a form using node-fetch:

var form = new FormData();

form.append('a', 1);

fetch('http://example.com', { method: 'POST', body: form })
    .then(function(res) {
        return res.json();
    }).then(function(json) {
        console.log(json);
    });

License

Form-Data is licensed under the MIT license.

FAQs

Last updated on 20 Jul 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc