main page
This commit is contained in:
19
node_modules/isomorphic-form-data/License
generated
vendored
Normal file
19
node_modules/isomorphic-form-data/License
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
46
node_modules/isomorphic-form-data/Readme.md
generated
vendored
Normal file
46
node_modules/isomorphic-form-data/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
A library to create readable ```"multipart/form-data"``` isomorphically in node and the browser.
|
||||
|
||||
[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
|
||||
[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
|
||||
|
||||
## 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.
|
||||
|
||||
``` javascript
|
||||
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](https://github.com/matthew-andrews/isomorphic-fetch):
|
||||
|
||||
```javascript
|
||||
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.
|
||||
1
node_modules/isomorphic-form-data/lib/browser.js
generated
vendored
Normal file
1
node_modules/isomorphic-form-data/lib/browser.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = window.FormData
|
||||
1
node_modules/isomorphic-form-data/lib/index.js
generated
vendored
Normal file
1
node_modules/isomorphic-form-data/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
global.FormData = module.exports = require('form-data')
|
||||
22
node_modules/isomorphic-form-data/package.json
generated
vendored
Normal file
22
node_modules/isomorphic-form-data/package.json
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"author": "Dylan Piercey <pierceydylan@gmail.com>",
|
||||
"name": "isomorphic-form-data",
|
||||
"description": "A library to create readable \"multipart/form-data\" in node and the browser.",
|
||||
"version": "2.0.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/form-data/isomorphic-form-data.git"
|
||||
},
|
||||
"main": "./lib/index",
|
||||
"browser": "./lib/browser",
|
||||
"scripts": {
|
||||
"test": "./test/run.js"
|
||||
},
|
||||
"pre-commit": [
|
||||
"test"
|
||||
],
|
||||
"dependencies": {
|
||||
"form-data": "^2.3.2"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
Reference in New Issue
Block a user