Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed uuid dependency

  • Loading branch information...
commit 632e31d130cb15564e7be2382137fca4f1951160 1 parent 8ffed11
@coolaj86 authored
Showing with 20 additions and 12 deletions.
  1. +2 −0  README.md
  2. +15 −2 formaline.js
  3. +3 −10 package.json
View
2  README.md
@@ -7,6 +7,8 @@ It doesn't include the kitchen sink, but it's got at least a drawer or two and c
If you don't think Formaline is light-weight enough for you, you're crazy.
Also, you'd probably really like [PoorForm](http://github.com/coolaj86/poor-form).
+The **[Formaline v0.x](https://github.com/rootslab/formaline/tree/v0.x)** [documentation](https://github.com/rootslab/formaline/blob/v0.x/Readme.md) is available on the v0.x branch. v0.6.4 seems to be the best version. It never made it to v1.0.0.
+
## API
* [`Formaline.create(request, options)`](#formalinecreaterequest-options)
View
17 formaline.js
@@ -9,9 +9,21 @@
, cryptostream = require('./cryptostream')
, fs = require('fs')
, path = require('path')
- , UUID = require('node-uuid')
+ , alphanum = '0123456789abcdefghijklmnopqrstuvwxyz'
;
+ function randomString(length, chars) {
+ var result = ''
+ , i
+ ;
+
+ for (i = 0; i < length; i += 1) {
+ result += chars[Math.round(Math.random() * (chars.length - 1))];
+ }
+
+ return result;
+ }
+
os.tmpDir = os.tmpDir || function () {
return process.env.TMP || process.env.TMP || '/tmp';
};
@@ -151,7 +163,7 @@
}
poorForm.emit('file', headers.name /*form name, not file name*/, curFile);
if (null !== options.path) {
- curFile.path = path.join(options.path, UUID.v4());
+ curFile.path = path.join(options.path, randomString(64, alphanum));
curFile.pipe(fs.createWriteStream(curFile.path));
}
} else {
@@ -241,4 +253,5 @@
};
module.exports.Formaline = Formaline;
+ module.exports.GoodForm = Formaline;
}());
View
13 package.json
@@ -4,18 +4,9 @@
"description": "Built upon the ultrafast poor-form, truly a formidable competitor.",
"main": "formaline.js",
"dependencies": {
- "poor-form": ">=1.0.2 <1.1.0",
- "connect": "~2.6.0",
- "node-uuid": ">=1.4.0 <1.5.0"
+ "poor-form": ">=1.0.2 <1.1.0"
},
"devDependencies": {
- "FormData": "*",
- "File": "*",
- "bufferjs": "1.x",
- "ahr2": "2.x",
- "walk": "2.x",
- "loop": ">=2.1.1 <2.2.0",
- "forEachAsync": "2.x"
},
"scripts": {
"test": "node test.js & sleep 1; bash test.sh"
@@ -27,6 +18,8 @@
"keywords": [
"formaline",
"formidable",
+ "good-form",
+ "poor-form",
"multipart",
"upload",
"form",
Please sign in to comment.
Something went wrong with that request. Please try again.