# node-formdata

> Uploads a file to a server via http formdata

Latest version **0.1.8** (published 2015-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-formdata
pnpm add node-formdata
yarn add node-formdata
bun add node-formdata
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2015-03-19 |
| First published | 2014-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | mwaylabs |
| Maintainers | mwaylabs |

## Links

- npm: https://www.npmjs.com/package/node-formdata
- npm.io page: https://npm.io/package/node-formdata

## Dependencies (2)

- [q](https://npm.io/package/q.md) ^1.0.1
- [request](https://npm.io/package/request.md) ^2.36.0

## Recent versions

- 0.1.8 (latest) — 2015-03-19
- 0.1.7 — 2014-09-24
- 0.1.6 — 2014-08-20
- 0.1.5 — 2014-08-13
- 0.1.4 — 2014-08-13
- 0.1.3 — 2014-07-29
- 0.1.2 — 2014-07-24
- 0.1.1 — 2014-07-11
- 0.1.0 — 2014-07-07
- 0.0.2 — 2014-07-04
- 0.0.1 — 2014-07-04

## README

# node formdata

Uploads a file to a server via http formdata

## Install

```
git clone https://github.com/mwaylabs/node-formdata.git
cd node-formdata
npm install
```

or

```
npm install node-formdata
```

## Usage
start the server with: `node server.js` to test this example against.

```
var fileUpload = require('node-formdata');

var defaultOptions = {
    hostname: '0.0.0.0',
    port: 27372,
    path: '/upload',
    method: 'POST',
    verbose: true,
    file: './file.txt',
    progress: function(){},
    error: function(){}
};

//HTTP
fileUpload(defaultOptions).then(function() {
    console.log('end');
}, function() {
    console.log('error');
}, function( progress ) {
    console.log('upload progress', progress);
});

// HTTP
fileUpload(defaultOptions, 'http');

// HTTPS
fileUpload(defaultOptions, 'https');

```

## Test

```
mocha
```

---
_Source: https://npm.io/package/node-formdata · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
