Permalink
Browse files

removed dep of node-uuid

  • Loading branch information...
1 parent 8ffed11 commit 26af7c382550cfc45968f40a0ad68bcc3d606df2 @coolaj86 committed Nov 12, 2012
Showing with 20 additions and 14 deletions.
  1. +15 −2 formaline.js
  2. +5 −12 package.json
View
@@ -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
@@ -1,21 +1,12 @@
{
- "name": "formaline",
- "version": "2.0.0-rc.1",
+ "name": "good-form",
+ "version": "1.0.0",
"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",

0 comments on commit 26af7c3

Please sign in to comment.