Skip to content

Commit

Permalink
dependencies: Set form-data as optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Oct 15, 2013
1 parent 751ac28 commit bcc138d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"forever-agent": "~0.5.0",
"tough-cookie": "~0.9.15",
"node-uuid": "~1.4.0",
"mime": "~1.2.9",
"form-data": "~0.1.0"
"mime": "~1.2.9"
},
"optionalDependencies": {
"form-data": "~0.1.0",
"tunnel-agent": "~0.3.0",
"http-signature": "~0.10.0",
"oauth-sign": "~0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion request.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var optional = require('./lib/optional')
, _safeStringify = require('json-stringify-safe')

, ForeverAgent = require('forever-agent')
, FormData = require('form-data')
, FormData = optional('form-data')

, Cookie = require('tough-cookie')
, CookieJar = Cookie.CookieJar
Expand Down
8 changes: 8 additions & 0 deletions tests/test-form.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
try {
require('form-data')
} catch (e) {
console.error('form-data must be installed to run this test.')
console.error('skipping this test. please install form-data and run again if you need to test this feature.')
process.exit(0)
}

var assert = require('assert')
var http = require('http');
var path = require('path');
Expand Down

0 comments on commit bcc138d

Please sign in to comment.