mirror of
https://github.com/arnaucube/comunicationLeap.git
synced 2026-02-07 11:26:43 +01:00
nodejs with express server, leapmotion for movement control, and threejs for 3d render
This commit is contained in:
15
node_modules/.bin/express
generated
vendored
Normal file
15
node_modules/.bin/express
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../express/bin/express" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../express/bin/express" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/.bin/express.cmd
generated
vendored
Normal file
7
node_modules/.bin/express.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\express\bin\express" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\express\bin\express" %*
|
||||
)
|
||||
15
node_modules/.bin/wscat
generated
vendored
Normal file
15
node_modules/.bin/wscat
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
basedir=`dirname "$0"`
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
||||
esac
|
||||
|
||||
if [ -x "$basedir/node" ]; then
|
||||
"$basedir/node" "$basedir/../ws/bin/wscat" "$@"
|
||||
ret=$?
|
||||
else
|
||||
node "$basedir/../ws/bin/wscat" "$@"
|
||||
ret=$?
|
||||
fi
|
||||
exit $ret
|
||||
7
node_modules/.bin/wscat.cmd
generated
vendored
Normal file
7
node_modules/.bin/wscat.cmd
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@IF EXIST "%~dp0\node.exe" (
|
||||
"%~dp0\node.exe" "%~dp0\..\ws\bin\wscat" %*
|
||||
) ELSE (
|
||||
@SETLOCAL
|
||||
@SET PATHEXT=%PATHEXT:;.JS;=;%
|
||||
node "%~dp0\..\ws\bin\wscat" %*
|
||||
)
|
||||
2
node_modules/after/.npmignore
generated
vendored
Normal file
2
node_modules/after/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
.monitor
|
||||
5
node_modules/after/.travis.yml
generated
vendored
Normal file
5
node_modules/after/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
- 0.9
|
||||
19
node_modules/after/LICENCE
generated
vendored
Normal file
19
node_modules/after/LICENCE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2011 Raynos.
|
||||
|
||||
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.
|
||||
75
node_modules/after/README.md
generated
vendored
Normal file
75
node_modules/after/README.md
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
# After [![Build Status][1]][2]
|
||||
|
||||
Invoke callback after n calls
|
||||
|
||||
## Status: production ready
|
||||
|
||||
## Example
|
||||
|
||||
var after = require("after")
|
||||
, next = after(3, logItWorks)
|
||||
|
||||
next()
|
||||
next()
|
||||
next() // it works
|
||||
|
||||
function logItWorks() {
|
||||
console.log("it works!")
|
||||
}
|
||||
|
||||
## Example with error handling
|
||||
|
||||
var after = require("after")
|
||||
, next = after(3, logError)
|
||||
|
||||
next()
|
||||
next(new Error("oops")) // logs oops
|
||||
next() // does nothing
|
||||
|
||||
function logError(err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
## After < 0.6.0
|
||||
|
||||
Older versions of after had iterators and flows in them.
|
||||
|
||||
These have been replaced with seperate modules
|
||||
|
||||
- [iterators][8]
|
||||
- [composite][9]
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install after`
|
||||
|
||||
## Tests
|
||||
|
||||
`npm test`
|
||||
|
||||
## Blog post
|
||||
|
||||
- [Flow control in node.js][3]
|
||||
|
||||
## Examples :
|
||||
|
||||
- [Determining the end of asynchronous operations][4]
|
||||
- [In javascript what are best practices for executing multiple asynchronous functions][5]
|
||||
- [JavaScript performance long running tasks][6]
|
||||
- [Synchronous database queries with node.js][7]
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[1]: https://secure.travis-ci.org/Raynos/after.png
|
||||
[2]: http://travis-ci.org/Raynos/after
|
||||
[3]: http://raynos.org/blog/2/Flow-control-in-node.js
|
||||
[4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307
|
||||
[5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031
|
||||
[6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419
|
||||
[7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091
|
||||
[8]: http://github.com/Raynos/iterators
|
||||
[9]: http://github.com/Raynos/composite
|
||||
28
node_modules/after/index.js
generated
vendored
Normal file
28
node_modules/after/index.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
module.exports = after
|
||||
|
||||
function after(count, callback, err_cb) {
|
||||
var bail = false
|
||||
err_cb = err_cb || noop
|
||||
proxy.count = count
|
||||
|
||||
return (count === 0) ? callback() : proxy
|
||||
|
||||
function proxy(err, result) {
|
||||
if (proxy.count <= 0) {
|
||||
throw new Error('after called too many times')
|
||||
}
|
||||
--proxy.count
|
||||
|
||||
// after first error, rest are passed to err_cb
|
||||
if (err) {
|
||||
bail = true
|
||||
callback(err)
|
||||
// future error callbacks will go to error handler
|
||||
callback = err_cb
|
||||
} else if (proxy.count === 0 && !bail) {
|
||||
callback(null, result)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function noop() {}
|
||||
88
node_modules/after/package.json
generated
vendored
Normal file
88
node_modules/after/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"after@0.8.1",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "after@0.8.1",
|
||||
"_id": "after@0.8.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/after",
|
||||
"_npmUser": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "raynos"
|
||||
},
|
||||
"_npmVersion": "1.2.25",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "after",
|
||||
"raw": "after@0.8.1",
|
||||
"rawSpec": "0.8.1",
|
||||
"scope": null,
|
||||
"spec": "0.8.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/after/-/after-0.8.1.tgz",
|
||||
"_shasum": "ab5d4fb883f596816d3515f8f791c0af486dd627",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "after@0.8.1",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser",
|
||||
"author": {
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "Raynos"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/Raynos/after/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "Raynos",
|
||||
"url": "http://raynos.org"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "after - tiny flow control",
|
||||
"devDependencies": {
|
||||
"mocha": "~1.8.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "ab5d4fb883f596816d3515f8f791c0af486dd627",
|
||||
"tarball": "http://registry.npmjs.org/after/-/after-0.8.1.tgz"
|
||||
},
|
||||
"homepage": "https://github.com/Raynos/after#readme",
|
||||
"keywords": [
|
||||
"flowcontrol",
|
||||
"after",
|
||||
"flow",
|
||||
"control",
|
||||
"arch"
|
||||
],
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "raynos2@gmail.com",
|
||||
"name": "raynos"
|
||||
},
|
||||
{
|
||||
"email": "shtylman@gmail.com",
|
||||
"name": "shtylman"
|
||||
}
|
||||
],
|
||||
"name": "after",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/Raynos/after.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha --ui tdd --reporter spec test/*.js"
|
||||
},
|
||||
"version": "0.8.1"
|
||||
}
|
||||
120
node_modules/after/test/after-test.js
generated
vendored
Normal file
120
node_modules/after/test/after-test.js
generated
vendored
Normal file
@@ -0,0 +1,120 @@
|
||||
/*global suite, test*/
|
||||
|
||||
var assert = require("assert")
|
||||
, after = require("../")
|
||||
|
||||
test("exists", function () {
|
||||
assert(typeof after === "function", "after is not a function")
|
||||
})
|
||||
|
||||
test("after when called with 0 invokes", function (done) {
|
||||
after(0, done)
|
||||
});
|
||||
|
||||
test("after 1", function (done) {
|
||||
var next = after(1, done)
|
||||
next()
|
||||
})
|
||||
|
||||
test("after 5", function (done) {
|
||||
var next = after(5, done)
|
||||
, i = 5
|
||||
|
||||
while (i--) {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
test("manipulate count", function (done) {
|
||||
var next = after(1, done)
|
||||
, i = 5
|
||||
|
||||
next.count = i
|
||||
while (i--) {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
test("after terminates on error", function (done) {
|
||||
var next = after(2, function(err) {
|
||||
assert.equal(err.message, 'test');
|
||||
done();
|
||||
})
|
||||
next(new Error('test'))
|
||||
next(new Error('test2'))
|
||||
})
|
||||
|
||||
test('gee', function(done) {
|
||||
done = after(2, done)
|
||||
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
assert.equal(err.message, 2)
|
||||
done()
|
||||
});
|
||||
|
||||
next()
|
||||
next(new Error(1))
|
||||
next(new Error(2))
|
||||
})
|
||||
|
||||
test('eee', function(done) {
|
||||
done = after(3, done)
|
||||
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
assert.equal(err.message, 2)
|
||||
done()
|
||||
});
|
||||
|
||||
next(new Error(1))
|
||||
next(new Error(2))
|
||||
next(new Error(2))
|
||||
})
|
||||
|
||||
test('gge', function(done) {
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
// should not happen
|
||||
assert.ok(false);
|
||||
});
|
||||
|
||||
next()
|
||||
next()
|
||||
next(new Error(1))
|
||||
})
|
||||
|
||||
test('egg', function(done) {
|
||||
function cb(err) {
|
||||
assert.equal(err.message, 1);
|
||||
done()
|
||||
}
|
||||
|
||||
var next = after(3, cb, function(err) {
|
||||
// should not happen
|
||||
assert.ok(false);
|
||||
});
|
||||
|
||||
next(new Error(1))
|
||||
next()
|
||||
next()
|
||||
})
|
||||
|
||||
test('throws on too many calls', function(done) {
|
||||
var next = after(1, done);
|
||||
next()
|
||||
assert.throws(next, /after called too many times/);
|
||||
});
|
||||
|
||||
17
node_modules/arraybuffer.slice/.npmignore
generated
vendored
Normal file
17
node_modules/arraybuffer.slice/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
lib-cov
|
||||
lcov.info
|
||||
*.seed
|
||||
*.log
|
||||
*.csv
|
||||
*.dat
|
||||
*.out
|
||||
*.pid
|
||||
*.gz
|
||||
|
||||
pids
|
||||
logs
|
||||
results
|
||||
build
|
||||
.grunt
|
||||
|
||||
node_modules
|
||||
8
node_modules/arraybuffer.slice/Makefile
generated
vendored
Normal file
8
node_modules/arraybuffer.slice/Makefile
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
REPORTER = dot
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/mocha \
|
||||
--reporter $(REPORTER)
|
||||
|
||||
.PHONY: test
|
||||
17
node_modules/arraybuffer.slice/README.md
generated
vendored
Normal file
17
node_modules/arraybuffer.slice/README.md
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# How to
|
||||
```javascript
|
||||
var sliceBuffer = require('arraybuffer.slice');
|
||||
var ab = (new Int8Array(5)).buffer;
|
||||
var sliced = sliceBuffer(ab, 1, 3);
|
||||
sliced = sliceBuffer(ab, 1);
|
||||
```
|
||||
|
||||
# Licence (MIT)
|
||||
Copyright (C) 2013 Rase-
|
||||
|
||||
|
||||
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.
|
||||
29
node_modules/arraybuffer.slice/index.js
generated
vendored
Normal file
29
node_modules/arraybuffer.slice/index.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* An abstraction for slicing an arraybuffer even when
|
||||
* ArrayBuffer.prototype.slice is not supported
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function(arraybuffer, start, end) {
|
||||
var bytes = arraybuffer.byteLength;
|
||||
start = start || 0;
|
||||
end = end || bytes;
|
||||
|
||||
if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
|
||||
|
||||
if (start < 0) { start += bytes; }
|
||||
if (end < 0) { end += bytes; }
|
||||
if (end > bytes) { end = bytes; }
|
||||
|
||||
if (start >= bytes || start >= end || bytes === 0) {
|
||||
return new ArrayBuffer(0);
|
||||
}
|
||||
|
||||
var abv = new Uint8Array(arraybuffer);
|
||||
var result = new Uint8Array(end - start);
|
||||
for (var i = start, ii = 0; i < end; i++, ii++) {
|
||||
result[ii] = abv[i];
|
||||
}
|
||||
return result.buffer;
|
||||
};
|
||||
64
node_modules/arraybuffer.slice/package.json
generated
vendored
Normal file
64
node_modules/arraybuffer.slice/package.json
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"arraybuffer.slice@0.0.6",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "arraybuffer.slice@0.0.6",
|
||||
"_id": "arraybuffer.slice@0.0.6",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/arraybuffer.slice",
|
||||
"_npmUser": {
|
||||
"email": "tonykovanen@hotmail.com",
|
||||
"name": "rase-"
|
||||
},
|
||||
"_npmVersion": "1.3.5",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "arraybuffer.slice",
|
||||
"raw": "arraybuffer.slice@0.0.6",
|
||||
"rawSpec": "0.0.6",
|
||||
"scope": null,
|
||||
"spec": "0.0.6",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz",
|
||||
"_shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "arraybuffer.slice@0.0.6",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser",
|
||||
"bugs": {
|
||||
"url": "https://github.com/rase-/arraybuffer.slice/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Exports a function for slicing ArrayBuffers (no polyfilling)",
|
||||
"devDependencies": {
|
||||
"expect.js": "0.2.0",
|
||||
"mocha": "1.17.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca",
|
||||
"tarball": "http://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz"
|
||||
},
|
||||
"homepage": "https://github.com/rase-/arraybuffer.slice",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tonykovanen@hotmail.com",
|
||||
"name": "rase-"
|
||||
}
|
||||
],
|
||||
"name": "arraybuffer.slice",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/rase-/arraybuffer.slice.git"
|
||||
},
|
||||
"version": "0.0.6"
|
||||
}
|
||||
227
node_modules/arraybuffer.slice/test/slice-buffer.js
generated
vendored
Normal file
227
node_modules/arraybuffer.slice/test/slice-buffer.js
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
/*
|
||||
* Test dependencies
|
||||
*/
|
||||
|
||||
var sliceBuffer = require('../index.js');
|
||||
var expect = require('expect.js');
|
||||
|
||||
/**
|
||||
* Tests
|
||||
*/
|
||||
|
||||
describe('sliceBuffer', function() {
|
||||
describe('using standard slice', function() {
|
||||
it('should slice correctly with only start provided', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, 3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 3, ii = 0; i < abv.length; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with start and end provided', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, 3, 8);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 3, ii = 0; i < 8; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with negative start', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, -3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with negative end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, 0, -3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with negative start and end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, -6, -3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with equal start and end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, 1, 1);
|
||||
expect(sliced.byteLength).to.equal(0);
|
||||
});
|
||||
|
||||
it('should slice correctly when end larger than buffer', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, 0, 100);
|
||||
expect(new Uint8Array(sliced)).to.eql(abv);
|
||||
});
|
||||
|
||||
it('shoud slice correctly when start larger than end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
|
||||
var sliced = sliceBuffer(abv.buffer, 6, 5);
|
||||
expect(sliced.byteLength).to.equal(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('using fallback', function() {
|
||||
it('should slice correctly with only start provided', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
var sliced = sliceBuffer(ab, 3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 3, ii = 0; i < abv.length; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with start and end provided', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
|
||||
var sliced = sliceBuffer(ab, 3, 8);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 3, ii = 0; i < 8; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with negative start', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
|
||||
var sliced = sliceBuffer(ab, -3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with negative end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
var sliced = sliceBuffer(ab, 0, -3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with negative start and end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
var sliced = sliceBuffer(ab, -6, -3);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) {
|
||||
expect(abv[i]).to.equal(sabv[ii]);
|
||||
}
|
||||
});
|
||||
|
||||
it('should slice correctly with equal start and end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
var sliced = sliceBuffer(ab, 1, 1);
|
||||
expect(sliced.byteLength).to.equal(0);
|
||||
});
|
||||
|
||||
it('should slice correctly when end larger than buffer', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
var sliced = sliceBuffer(ab, 0, 100);
|
||||
var sabv = new Uint8Array(sliced);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
expect(abv[i]).to.equal(sabv[i]);
|
||||
}
|
||||
});
|
||||
|
||||
it('shoud slice correctly when start larger than end', function() {
|
||||
var abv = new Uint8Array(10);
|
||||
for (var i = 0; i < abv.length; i++) {
|
||||
abv[i] = i;
|
||||
}
|
||||
var ab = abv.buffer;
|
||||
ab.slice = undefined;
|
||||
|
||||
var sliced = sliceBuffer(ab, 6, 5);
|
||||
expect(sliced.byteLength).to.equal(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
1
node_modules/base64-arraybuffer/.npmignore
generated
vendored
Normal file
1
node_modules/base64-arraybuffer/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/node_modules/
|
||||
6
node_modules/base64-arraybuffer/.travis.yml
generated
vendored
Normal file
6
node_modules/base64-arraybuffer/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
language: node_js
|
||||
node_js:
|
||||
- '0.10'
|
||||
before_script:
|
||||
- npm install
|
||||
22
node_modules/base64-arraybuffer/LICENSE-MIT
generated
vendored
Normal file
22
node_modules/base64-arraybuffer/LICENSE-MIT
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2012 Niklas von Hertzen
|
||||
|
||||
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.
|
||||
23
node_modules/base64-arraybuffer/README.md
generated
vendored
Normal file
23
node_modules/base64-arraybuffer/README.md
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# base64-arraybuffer
|
||||
|
||||
[](https://travis-ci.org/niklasvh/base64-arraybuffer)
|
||||
|
||||
Encode/decode base64 data into ArrayBuffers
|
||||
|
||||
## Getting Started
|
||||
Install the module with: `npm install base64-arraybuffer`
|
||||
|
||||
## API
|
||||
The library encodes and decodes base64 to and from ArrayBuffers
|
||||
|
||||
- __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string
|
||||
- __decode(str)__ - Decodes base64 string to `ArrayBuffer`
|
||||
|
||||
## Release History
|
||||
|
||||
- 0.1.2 - Fix old format of typed arrays
|
||||
- 0.1.0 - Initial version, basic decode/encode base64 to and from ArrayBuffer
|
||||
|
||||
## License
|
||||
Copyright (c) 2012 Niklas von Hertzen
|
||||
Licensed under the MIT license.
|
||||
23
node_modules/base64-arraybuffer/README.md~
generated
vendored
Normal file
23
node_modules/base64-arraybuffer/README.md~
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# base64-arraybuffer
|
||||
|
||||
[](https://travis-ci.org/niklasvh/base64-arraybuffer)
|
||||
|
||||
Encode/decode base64 data into ArrayBuffers
|
||||
|
||||
## Getting Started
|
||||
Install the module with: `npm install base64-arraybuffer`
|
||||
|
||||
## API
|
||||
The library encodes and decodes base64 to and from ArrayBuffers
|
||||
|
||||
- __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string
|
||||
- __decode(str)__ - Decodes base64 string to `ArrayBuffer`
|
||||
|
||||
## Release History
|
||||
|
||||
- 0.1.2 - Fix old format of typed arrays
|
||||
- 0.1.0 - Initial version, basic decode/encode base64 to and from ArrayBuffer
|
||||
|
||||
## License
|
||||
Copyright (c) 2012 Niklas von Hertzen
|
||||
Licensed under the MIT license.
|
||||
39
node_modules/base64-arraybuffer/grunt.js
generated
vendored
Normal file
39
node_modules/base64-arraybuffer/grunt.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
module.exports = function(grunt) {
|
||||
"use strict";
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: '<json:package.json>',
|
||||
test: {
|
||||
files: ['test/**/*.js']
|
||||
},
|
||||
lint: {
|
||||
files: ['grunt.js', 'lib/**/*.js', 'test/**/*.js']
|
||||
},
|
||||
watch: {
|
||||
files: '<config:lint.files>',
|
||||
tasks: 'default'
|
||||
},
|
||||
jshint: {
|
||||
options: {
|
||||
curly: true,
|
||||
eqeqeq: true,
|
||||
immed: true,
|
||||
latedef: true,
|
||||
newcap: true,
|
||||
noarg: true,
|
||||
sub: true,
|
||||
undef: true,
|
||||
boss: true,
|
||||
eqnull: true,
|
||||
node: true
|
||||
},
|
||||
globals: {
|
||||
exports: true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Default task.
|
||||
grunt.registerTask('default', 'test');
|
||||
|
||||
};
|
||||
59
node_modules/base64-arraybuffer/lib/base64-arraybuffer.js
generated
vendored
Normal file
59
node_modules/base64-arraybuffer/lib/base64-arraybuffer.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* base64-arraybuffer
|
||||
* https://github.com/niklasvh/base64-arraybuffer
|
||||
*
|
||||
* Copyright (c) 2012 Niklas von Hertzen
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
(function(chars){
|
||||
"use strict";
|
||||
|
||||
exports.encode = function(arraybuffer) {
|
||||
var bytes = new Uint8Array(arraybuffer),
|
||||
i, len = bytes.length, base64 = "";
|
||||
|
||||
for (i = 0; i < len; i+=3) {
|
||||
base64 += chars[bytes[i] >> 2];
|
||||
base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
|
||||
base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
|
||||
base64 += chars[bytes[i + 2] & 63];
|
||||
}
|
||||
|
||||
if ((len % 3) === 2) {
|
||||
base64 = base64.substring(0, base64.length - 1) + "=";
|
||||
} else if (len % 3 === 1) {
|
||||
base64 = base64.substring(0, base64.length - 2) + "==";
|
||||
}
|
||||
|
||||
return base64;
|
||||
};
|
||||
|
||||
exports.decode = function(base64) {
|
||||
var bufferLength = base64.length * 0.75,
|
||||
len = base64.length, i, p = 0,
|
||||
encoded1, encoded2, encoded3, encoded4;
|
||||
|
||||
if (base64[base64.length - 1] === "=") {
|
||||
bufferLength--;
|
||||
if (base64[base64.length - 2] === "=") {
|
||||
bufferLength--;
|
||||
}
|
||||
}
|
||||
|
||||
var arraybuffer = new ArrayBuffer(bufferLength),
|
||||
bytes = new Uint8Array(arraybuffer);
|
||||
|
||||
for (i = 0; i < len; i+=4) {
|
||||
encoded1 = chars.indexOf(base64[i]);
|
||||
encoded2 = chars.indexOf(base64[i+1]);
|
||||
encoded3 = chars.indexOf(base64[i+2]);
|
||||
encoded4 = chars.indexOf(base64[i+3]);
|
||||
|
||||
bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
|
||||
bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
|
||||
bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
|
||||
}
|
||||
|
||||
return arraybuffer;
|
||||
};
|
||||
})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
|
||||
82
node_modules/base64-arraybuffer/package.json
generated
vendored
Normal file
82
node_modules/base64-arraybuffer/package.json
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"base64-arraybuffer@0.1.2",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "base64-arraybuffer@0.1.2",
|
||||
"_id": "base64-arraybuffer@0.1.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/base64-arraybuffer",
|
||||
"_npmUser": {
|
||||
"email": "niklasvh@gmail.com",
|
||||
"name": "niklasvh"
|
||||
},
|
||||
"_npmVersion": "1.3.21",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "base64-arraybuffer",
|
||||
"raw": "base64-arraybuffer@0.1.2",
|
||||
"rawSpec": "0.1.2",
|
||||
"scope": null,
|
||||
"spec": "0.1.2",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.2.tgz",
|
||||
"_shasum": "474df4a9f2da24e05df3158c3b1db3c3cd46a154",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "base64-arraybuffer@0.1.2",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser",
|
||||
"author": {
|
||||
"email": "niklasvh@gmail.com",
|
||||
"name": "Niklas von Hertzen",
|
||||
"url": "http://hertzen.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/niklasvh/base64-arraybuffer/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Encode/decode base64 data into ArrayBuffers",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.3.17"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "474df4a9f2da24e05df3158c3b1db3c3cd46a154",
|
||||
"tarball": "http://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6.0"
|
||||
},
|
||||
"homepage": "https://github.com/niklasvh/base64-arraybuffer",
|
||||
"keywords": [],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT"
|
||||
}
|
||||
],
|
||||
"main": "lib/base64-arraybuffer",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "niklasvh@gmail.com",
|
||||
"name": "niklasvh"
|
||||
}
|
||||
],
|
||||
"name": "base64-arraybuffer",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/niklasvh/base64-arraybuffer.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"version": "0.1.2"
|
||||
}
|
||||
35
node_modules/base64-arraybuffer/package.json~
generated
vendored
Normal file
35
node_modules/base64-arraybuffer/package.json~
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "base64-arraybuffer",
|
||||
"description": "Encode/decode base64 data into ArrayBuffers",
|
||||
"version": "0.1.1",
|
||||
"homepage": "https://github.com/niklasvh/base64-arraybuffer",
|
||||
"author": {
|
||||
"name": "Niklas von Hertzen",
|
||||
"email": "niklasvh@gmail.com",
|
||||
"url": "http://hertzen.com"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/niklasvh/base64-arraybuffer"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/niklasvh/base64-arraybuffer/issues"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT"
|
||||
}
|
||||
],
|
||||
"main": "lib/base64-arraybuffer",
|
||||
"engines": {
|
||||
"node": ">= 0.6.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "grunt test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "~0.3.17"
|
||||
},
|
||||
"keywords": []
|
||||
}
|
||||
72
node_modules/base64-arraybuffer/test/base64-arraybuffer_test.js
generated
vendored
Normal file
72
node_modules/base64-arraybuffer/test/base64-arraybuffer_test.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
(function(){
|
||||
"use strict";
|
||||
var base64_arraybuffer = require('../lib/base64-arraybuffer.js');
|
||||
|
||||
/*
|
||||
======== A Handy Little Nodeunit Reference ========
|
||||
https://github.com/caolan/nodeunit
|
||||
|
||||
Test methods:
|
||||
test.expect(numAssertions)
|
||||
test.done()
|
||||
Test assertions:
|
||||
test.ok(value, [message])
|
||||
test.equal(actual, expected, [message])
|
||||
test.notEqual(actual, expected, [message])
|
||||
test.deepEqual(actual, expected, [message])
|
||||
test.notDeepEqual(actual, expected, [message])
|
||||
test.strictEqual(actual, expected, [message])
|
||||
test.notStrictEqual(actual, expected, [message])
|
||||
test.throws(block, [error], [message])
|
||||
test.doesNotThrow(block, [error], [message])
|
||||
test.ifError(value)
|
||||
*/
|
||||
|
||||
|
||||
function stringArrayBuffer(str) {
|
||||
var buffer = new ArrayBuffer(str.length);
|
||||
var bytes = new Uint8Array(buffer);
|
||||
|
||||
str.split('').forEach(function(str, i) {
|
||||
bytes[i] = str.charCodeAt(0);
|
||||
});
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
function testArrayBuffers(buffer1, buffer2) {
|
||||
var len1 = buffer1.byteLength,
|
||||
len2 = buffer2.byteLength;
|
||||
if (len1 !== len2) {
|
||||
console.log(buffer1, buffer2);
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < len1; i++) {
|
||||
if (buffer1[i] !== buffer1[i]) {
|
||||
console.log(i, buffer1, buffer2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
exports['base64tests'] = {
|
||||
'encode': function(test) {
|
||||
test.expect(4);
|
||||
|
||||
test.equal(base64_arraybuffer.encode(stringArrayBuffer("Hello world")), "SGVsbG8gd29ybGQ=", 'encode "Hello world"');
|
||||
test.equal(base64_arraybuffer.encode(stringArrayBuffer("Man")), 'TWFu', 'encode "Man"');
|
||||
test.equal(base64_arraybuffer.encode(stringArrayBuffer("Ma")), "TWE=", 'encode "Ma"');
|
||||
test.equal(base64_arraybuffer.encode(stringArrayBuffer("Hello worlds!")), "SGVsbG8gd29ybGRzIQ==", 'encode "Hello worlds!"');
|
||||
test.done();
|
||||
},
|
||||
'decode': function(test) {
|
||||
test.expect(3);
|
||||
test.ok(testArrayBuffers(base64_arraybuffer.decode("TWFu"), stringArrayBuffer("Man")), 'decode "Man"');
|
||||
test.ok(testArrayBuffers(base64_arraybuffer.decode("SGVsbG8gd29ybGQ="), stringArrayBuffer("Hello world")), 'decode "Hello world"');
|
||||
test.ok(testArrayBuffers(base64_arraybuffer.decode("SGVsbG8gd29ybGRzIQ=="), stringArrayBuffer("Hello worlds!")), 'decode "Hello worlds!"');
|
||||
test.done();
|
||||
}
|
||||
};
|
||||
})();
|
||||
3
node_modules/base64id/.npmignore
generated
vendored
Normal file
3
node_modules/base64id/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
18
node_modules/base64id/README.md
generated
vendored
Normal file
18
node_modules/base64id/README.md
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
base64id
|
||||
========
|
||||
|
||||
Node.js module that generates a base64 id.
|
||||
|
||||
Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4.
|
||||
|
||||
To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes.
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install mongoose
|
||||
|
||||
## Usage
|
||||
|
||||
var base64id = require('base64id');
|
||||
|
||||
var id = base64id.generateId();
|
||||
103
node_modules/base64id/lib/base64id.js
generated
vendored
Normal file
103
node_modules/base64id/lib/base64id.js
generated
vendored
Normal file
@@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* base64id v0.1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var crypto = require('crypto');
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
var Base64Id = function() { };
|
||||
|
||||
/**
|
||||
* Get random bytes
|
||||
*
|
||||
* Uses a buffer if available, falls back to crypto.randomBytes
|
||||
*/
|
||||
|
||||
Base64Id.prototype.getRandomBytes = function(bytes) {
|
||||
|
||||
var BUFFER_SIZE = 4096
|
||||
var self = this;
|
||||
|
||||
bytes = bytes || 12;
|
||||
|
||||
if (bytes > BUFFER_SIZE) {
|
||||
return crypto.randomBytes(bytes);
|
||||
}
|
||||
|
||||
var bytesInBuffer = parseInt(BUFFER_SIZE/bytes);
|
||||
var threshold = parseInt(bytesInBuffer*0.85);
|
||||
|
||||
if (!threshold) {
|
||||
return crypto.randomBytes(bytes);
|
||||
}
|
||||
|
||||
if (this.bytesBufferIndex == null) {
|
||||
this.bytesBufferIndex = -1;
|
||||
}
|
||||
|
||||
if (this.bytesBufferIndex == bytesInBuffer) {
|
||||
this.bytesBuffer = null;
|
||||
this.bytesBufferIndex = -1;
|
||||
}
|
||||
|
||||
// No buffered bytes available or index above threshold
|
||||
if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) {
|
||||
|
||||
if (!this.isGeneratingBytes) {
|
||||
this.isGeneratingBytes = true;
|
||||
crypto.randomBytes(BUFFER_SIZE, function(err, bytes) {
|
||||
self.bytesBuffer = bytes;
|
||||
self.bytesBufferIndex = 0;
|
||||
self.isGeneratingBytes = false;
|
||||
});
|
||||
}
|
||||
|
||||
// Fall back to sync call when no buffered bytes are available
|
||||
if (this.bytesBufferIndex == -1) {
|
||||
return crypto.randomBytes(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1));
|
||||
this.bytesBufferIndex++;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a base64 id
|
||||
*
|
||||
* (Original version from socket.io <http://socket.io>)
|
||||
*/
|
||||
|
||||
Base64Id.prototype.generateId = function () {
|
||||
var rand = new Buffer(15); // multiple of 3 for base64
|
||||
if (!rand.writeInt32BE) {
|
||||
return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString()
|
||||
+ Math.abs(Math.random() * Math.random() * Date.now() | 0).toString();
|
||||
}
|
||||
this.sequenceNumber = (this.sequenceNumber + 1) | 0;
|
||||
rand.writeInt32BE(this.sequenceNumber, 11);
|
||||
if (crypto.randomBytes) {
|
||||
this.getRandomBytes(12).copy(rand);
|
||||
} else {
|
||||
// not secure for node 0.4
|
||||
[0, 4, 8].forEach(function(i) {
|
||||
rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i);
|
||||
});
|
||||
}
|
||||
return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-');
|
||||
};
|
||||
|
||||
/**
|
||||
* Export
|
||||
*/
|
||||
|
||||
exports = module.exports = new Base64Id();
|
||||
72
node_modules/base64id/package.json
generated
vendored
Normal file
72
node_modules/base64id/package.json
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"base64id@0.1.0",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io"
|
||||
]
|
||||
],
|
||||
"_defaultsLoaded": true,
|
||||
"_engineSupported": true,
|
||||
"_from": "base64id@0.1.0",
|
||||
"_id": "base64id@0.1.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/base64id",
|
||||
"_nodeVersion": "v0.6.15",
|
||||
"_npmUser": {
|
||||
"email": "faeldt_kristian@cyberagent.co.jp",
|
||||
"name": "faeldt_kristian"
|
||||
},
|
||||
"_npmVersion": "1.1.16",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "base64id",
|
||||
"raw": "base64id@0.1.0",
|
||||
"rawSpec": "0.1.0",
|
||||
"scope": null,
|
||||
"spec": "0.1.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz",
|
||||
"_shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "base64id@0.1.0",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io",
|
||||
"author": {
|
||||
"email": "faeldt_kristian@cyberagent.co.jp",
|
||||
"name": "Kristian Faeldt"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/faeldt/base64id/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Generates a base64 id",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f",
|
||||
"tarball": "http://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
},
|
||||
"homepage": "https://github.com/faeldt/base64id#readme",
|
||||
"main": "./lib/base64id.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "faeldt_kristian@cyberagent.co.jp",
|
||||
"name": "faeldt_kristian"
|
||||
}
|
||||
],
|
||||
"name": "base64id",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/faeldt/base64id.git"
|
||||
},
|
||||
"version": "0.1.0"
|
||||
}
|
||||
22
node_modules/benchmark/LICENSE.txt
generated
vendored
Normal file
22
node_modules/benchmark/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
Copyright 2010-2012 Mathias Bynens <http://mathiasbynens.be/>
|
||||
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
|
||||
Modified by John-David Dalton <http://allyoucanleet.com/>
|
||||
|
||||
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.
|
||||
131
node_modules/benchmark/README.md
generated
vendored
Normal file
131
node_modules/benchmark/README.md
generated
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
# Benchmark.js <sup>v1.0.0</sup>
|
||||
|
||||
A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
|
||||
|
||||
## BestieJS
|
||||
|
||||
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation for Benchmark.js can be viewed here: <http://benchmarkjs.com/docs>
|
||||
|
||||
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
|
||||
|
||||
## Support
|
||||
|
||||
Benchmark.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1.5-13, IE 6-9, Opera 9.25-12.01, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
|
||||
|
||||
## Installation and usage
|
||||
|
||||
In a browser or Adobe AIR:
|
||||
|
||||
~~~ html
|
||||
<script src="benchmark.js"></script>
|
||||
~~~
|
||||
|
||||
Optionally, expose Java’s nanosecond timer by adding the `nano` applet to the `<body>`:
|
||||
|
||||
~~~ html
|
||||
<applet code="nano" archive="nano.jar"></applet>
|
||||
~~~
|
||||
|
||||
Or enable Chrome’s microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
|
||||
|
||||
--enable-benchmarking
|
||||
|
||||
Via [npm](http://npmjs.org/):
|
||||
|
||||
~~~ bash
|
||||
npm install benchmark
|
||||
~~~
|
||||
|
||||
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
|
||||
|
||||
~~~ js
|
||||
var Benchmark = require('benchmark');
|
||||
~~~
|
||||
|
||||
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
|
||||
|
||||
~~~ bash
|
||||
npm install microtime
|
||||
~~~
|
||||
|
||||
In [RingoJS v0.7.0-](http://ringojs.org/):
|
||||
|
||||
~~~ js
|
||||
var Benchmark = require('benchmark').Benchmark;
|
||||
~~~
|
||||
|
||||
In [Rhino](http://www.mozilla.org/rhino/):
|
||||
|
||||
~~~ js
|
||||
load('benchmark.js');
|
||||
~~~
|
||||
|
||||
In an AMD loader like [RequireJS](http://requirejs.org/):
|
||||
|
||||
~~~ js
|
||||
require({
|
||||
'paths': {
|
||||
'benchmark': 'path/to/benchmark'
|
||||
}
|
||||
},
|
||||
['benchmark'], function(Benchmark) {
|
||||
console.log(Benchmark.version);
|
||||
});
|
||||
|
||||
// or with platform.js
|
||||
// https://github.com/bestiejs/platform.js
|
||||
require({
|
||||
'paths': {
|
||||
'benchmark': 'path/to/benchmark',
|
||||
'platform': 'path/to/platform'
|
||||
}
|
||||
},
|
||||
['benchmark', 'platform'], function(Benchmark, platform) {
|
||||
Benchmark.platform = platform;
|
||||
console.log(Benchmark.platform.name);
|
||||
});
|
||||
~~~
|
||||
|
||||
Usage example:
|
||||
|
||||
~~~ js
|
||||
var suite = new Benchmark.Suite;
|
||||
|
||||
// add tests
|
||||
suite.add('RegExp#test', function() {
|
||||
/o/.test('Hello World!');
|
||||
})
|
||||
.add('String#indexOf', function() {
|
||||
'Hello World!'.indexOf('o') > -1;
|
||||
})
|
||||
// add listeners
|
||||
.on('cycle', function(event) {
|
||||
console.log(String(event.target));
|
||||
})
|
||||
.on('complete', function() {
|
||||
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
|
||||
})
|
||||
// run async
|
||||
.run({ 'async': true });
|
||||
|
||||
// logs:
|
||||
// > RegExp#test x 4,161,532 +-0.99% (59 cycles)
|
||||
// > String#indexOf x 6,139,623 +-1.00% (131 cycles)
|
||||
// > Fastest is String#indexOf
|
||||
~~~
|
||||
|
||||
## Authors
|
||||
|
||||
* [Mathias Bynens](http://mathiasbynens.be/)
|
||||
[](https://twitter.com/mathias "Follow @mathias on Twitter")
|
||||
* [John-David Dalton](http://allyoucanleet.com/)
|
||||
[](https://twitter.com/jdalton "Follow @jdalton on Twitter")
|
||||
|
||||
## Contributors
|
||||
|
||||
* [Kit Cambridge](http://kitcambridge.github.com/)
|
||||
[](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
|
||||
3918
node_modules/benchmark/benchmark.js
generated
vendored
Normal file
3918
node_modules/benchmark/benchmark.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2629
node_modules/benchmark/doc/README.md
generated
vendored
Normal file
2629
node_modules/benchmark/doc/README.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
88
node_modules/benchmark/package.json
generated
vendored
Normal file
88
node_modules/benchmark/package.json
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"benchmark@1.0.0",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "benchmark@1.0.0",
|
||||
"_id": "benchmark@1.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/benchmark",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "benchmark",
|
||||
"raw": "benchmark@1.0.0",
|
||||
"rawSpec": "1.0.0",
|
||||
"scope": null,
|
||||
"spec": "1.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/socket.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/benchmark/-/benchmark-1.0.0.tgz",
|
||||
"_shasum": "2f1e2fa4c359f11122aa183082218e957e390c73",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "benchmark@1.0.0",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-parser",
|
||||
"author": {
|
||||
"email": "mathias@benchmarkjs.com",
|
||||
"name": "Mathias Bynens",
|
||||
"url": "http://mathiasbynens.be/"
|
||||
},
|
||||
"bugs": {
|
||||
"email": "bugs@benchmarkjs.com",
|
||||
"url": "https://github.com/bestiejs/benchmark.js/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results.",
|
||||
"devDependencies": {},
|
||||
"directories": {
|
||||
"doc": "./doc",
|
||||
"test": "./test"
|
||||
},
|
||||
"dist": {
|
||||
"shasum": "2f1e2fa4c359f11122aa183082218e957e390c73",
|
||||
"tarball": "http://registry.npmjs.org/benchmark/-/benchmark-1.0.0.tgz"
|
||||
},
|
||||
"engines": [
|
||||
"node",
|
||||
"rhino"
|
||||
],
|
||||
"homepage": "http://benchmarkjs.com/",
|
||||
"keywords": [
|
||||
"benchmark",
|
||||
"narwhal",
|
||||
"node",
|
||||
"performance",
|
||||
"ringo",
|
||||
"speed"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://mths.be/mit"
|
||||
}
|
||||
],
|
||||
"main": "benchmark",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "john@fusejs.com",
|
||||
"name": "jdalton"
|
||||
},
|
||||
{
|
||||
"email": "mathias@qiwi.be",
|
||||
"name": "mathias"
|
||||
}
|
||||
],
|
||||
"name": "benchmark",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bestiejs/benchmark.js.git"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
9
node_modules/benchmark/test/run-test.sh
generated
vendored
Normal file
9
node_modules/benchmark/test/run-test.sh
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
cd "$(dirname "$0")"
|
||||
for cmd in rhino ringo narwhal node; do
|
||||
echo ""
|
||||
echo "Testing in $cmd..."
|
||||
$cmd test.js
|
||||
done
|
||||
echo ""
|
||||
echo "Testing in a browser..."
|
||||
open index.html
|
||||
2074
node_modules/benchmark/test/test.js
generated
vendored
Normal file
2074
node_modules/benchmark/test/test.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4
node_modules/better-assert/.npmignore
generated
vendored
Normal file
4
node_modules/better-assert/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
*.sock
|
||||
15
node_modules/better-assert/History.md
generated
vendored
Normal file
15
node_modules/better-assert/History.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
1.0.0 / 2013-02-03
|
||||
==================
|
||||
|
||||
* Stop using the removed magic __stack global getter
|
||||
|
||||
0.1.0 / 2012-10-04
|
||||
==================
|
||||
|
||||
* add throwing of AssertionError for test frameworks etc
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
5
node_modules/better-assert/Makefile
generated
vendored
Normal file
5
node_modules/better-assert/Makefile
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
test:
|
||||
@echo "populate me"
|
||||
|
||||
.PHONY: test
|
||||
61
node_modules/better-assert/Readme.md
generated
vendored
Normal file
61
node_modules/better-assert/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
# better-assert
|
||||
|
||||
Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for
|
||||
self-documenting failure messages.
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install better-assert
|
||||
|
||||
## Example
|
||||
|
||||
By default assertions are enabled, however the __NO_ASSERT__ environment variable
|
||||
will deactivate them when truthy.
|
||||
|
||||
```js
|
||||
var assert = require('better-assert');
|
||||
|
||||
test();
|
||||
|
||||
function test() {
|
||||
var user = { name: 'tobi' };
|
||||
assert('tobi' == user.name);
|
||||
assert('number' == typeof user.age);
|
||||
}
|
||||
|
||||
AssertionError: 'number' == typeof user.age
|
||||
at test (/Users/tj/projects/better-assert/example.js:9:3)
|
||||
at Object.<anonymous> (/Users/tj/projects/better-assert/example.js:4:1)
|
||||
at Module._compile (module.js:449:26)
|
||||
at Object.Module._extensions..js (module.js:467:10)
|
||||
at Module.load (module.js:356:32)
|
||||
at Function.Module._load (module.js:312:12)
|
||||
at Module.runMain (module.js:492:10)
|
||||
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
||||
10
node_modules/better-assert/example.js
generated
vendored
Normal file
10
node_modules/better-assert/example.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
var assert = require('./');
|
||||
|
||||
test();
|
||||
|
||||
function test() {
|
||||
var user = { name: 'tobi' };
|
||||
assert('tobi' == user.name);
|
||||
assert('number' == typeof user.age);
|
||||
}
|
||||
38
node_modules/better-assert/index.js
generated
vendored
Normal file
38
node_modules/better-assert/index.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var AssertionError = require('assert').AssertionError
|
||||
, callsite = require('callsite')
|
||||
, fs = require('fs')
|
||||
|
||||
/**
|
||||
* Expose `assert`.
|
||||
*/
|
||||
|
||||
module.exports = process.env.NO_ASSERT
|
||||
? function(){}
|
||||
: assert;
|
||||
|
||||
/**
|
||||
* Assert the given `expr`.
|
||||
*/
|
||||
|
||||
function assert(expr) {
|
||||
if (expr) return;
|
||||
|
||||
var stack = callsite();
|
||||
var call = stack[1];
|
||||
var file = call.getFileName();
|
||||
var lineno = call.getLineNumber();
|
||||
var src = fs.readFileSync(file, 'utf8');
|
||||
var line = src.split('\n')[lineno-1];
|
||||
var src = line.match(/assert\((.*)\)/)[1];
|
||||
|
||||
var err = new AssertionError({
|
||||
message: src,
|
||||
stackStartFunction: stack[0].getFunction()
|
||||
});
|
||||
|
||||
throw err;
|
||||
}
|
||||
93
node_modules/better-assert/package.json
generated
vendored
Normal file
93
node_modules/better-assert/package.json
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"better-assert@~1.0.0",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\parsejson"
|
||||
]
|
||||
],
|
||||
"_from": "better-assert@>=1.0.0 <1.1.0",
|
||||
"_id": "better-assert@1.0.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/better-assert",
|
||||
"_npmUser": {
|
||||
"email": "coolhzb@163.com",
|
||||
"name": "tony_ado"
|
||||
},
|
||||
"_npmVersion": "1.4.9",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "better-assert",
|
||||
"raw": "better-assert@~1.0.0",
|
||||
"rawSpec": "~1.0.0",
|
||||
"scope": null,
|
||||
"spec": ">=1.0.0 <1.1.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-client/parseuri",
|
||||
"/parsejson",
|
||||
"/parseqs",
|
||||
"/parseuri"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
|
||||
"_shasum": "40866b9e1b9e0b55b481894311e68faffaebc522",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "better-assert@~1.0.0",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\parsejson",
|
||||
"author": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "TJ Holowaychuk"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/visionmedia/better-assert/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"email": "coolhzb@163.com",
|
||||
"name": "TonyHe"
|
||||
},
|
||||
{
|
||||
"name": "ForbesLindesay"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"callsite": "1.0.0"
|
||||
},
|
||||
"description": "Better assertions for node, reporting the expr, filename, lineno etc",
|
||||
"devDependencies": {},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "40866b9e1b9e0b55b481894311e68faffaebc522",
|
||||
"tarball": "http://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"homepage": "https://github.com/visionmedia/better-assert",
|
||||
"keywords": [
|
||||
"assert",
|
||||
"stack",
|
||||
"trace",
|
||||
"debug"
|
||||
],
|
||||
"main": "index",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
},
|
||||
{
|
||||
"email": "coolhzb@163.com",
|
||||
"name": "tony_ado"
|
||||
}
|
||||
],
|
||||
"name": "better-assert",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/visionmedia/better-assert.git"
|
||||
},
|
||||
"version": "1.0.2"
|
||||
}
|
||||
2
node_modules/blob/.npmignore
generated
vendored
Normal file
2
node_modules/blob/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
blob.js
|
||||
8
node_modules/blob/.zuul.yml
generated
vendored
Normal file
8
node_modules/blob/.zuul.yml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
ui: mocha-bdd
|
||||
browsers:
|
||||
- name: chrome
|
||||
version: [8, latest]
|
||||
- name: ie
|
||||
version: 10
|
||||
- name: android
|
||||
version: latest
|
||||
14
node_modules/blob/Makefile
generated
vendored
Normal file
14
node_modules/blob/Makefile
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
REPORTER = dot
|
||||
|
||||
build: blob.js
|
||||
|
||||
blob.js:
|
||||
@./node_modules/.bin/browserify --standalone blob index.js > blob.js
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/zuul -- test/index.js
|
||||
|
||||
clean:
|
||||
rm blob.js
|
||||
|
||||
.PHONY: test blob.js
|
||||
11
node_modules/blob/README.md
generated
vendored
Normal file
11
node_modules/blob/README.md
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
Blob
|
||||
====
|
||||
|
||||
A module that exports a constructor that uses window.Blob when available, and a BlobBuilder with any vendor prefix in other cases. If neither is available, it exports undefined.
|
||||
|
||||
Usage:
|
||||
|
||||
```javascript
|
||||
var Blob = require('blob');
|
||||
var b = new Blob(['hi', 'constructing', 'a', 'blob']);
|
||||
```
|
||||
49
node_modules/blob/index.js
generated
vendored
Normal file
49
node_modules/blob/index.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Create a blob builder even when vendor prefixes exist
|
||||
*/
|
||||
|
||||
var BlobBuilder = global.BlobBuilder
|
||||
|| global.WebKitBlobBuilder
|
||||
|| global.MSBlobBuilder
|
||||
|| global.MozBlobBuilder;
|
||||
|
||||
/**
|
||||
* Check if Blob constructor is supported
|
||||
*/
|
||||
|
||||
var blobSupported = (function() {
|
||||
try {
|
||||
var b = new Blob(['hi']);
|
||||
return b.size == 2;
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
})();
|
||||
|
||||
/**
|
||||
* Check if BlobBuilder is supported
|
||||
*/
|
||||
|
||||
var blobBuilderSupported = BlobBuilder
|
||||
&& BlobBuilder.prototype.append
|
||||
&& BlobBuilder.prototype.getBlob;
|
||||
|
||||
function BlobBuilderConstructor(ary, options) {
|
||||
options = options || {};
|
||||
|
||||
var bb = new BlobBuilder();
|
||||
for (var i = 0; i < ary.length; i++) {
|
||||
bb.append(ary[i]);
|
||||
}
|
||||
return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
|
||||
};
|
||||
|
||||
module.exports = (function() {
|
||||
if (blobSupported) {
|
||||
return global.Blob;
|
||||
} else if (blobBuilderSupported) {
|
||||
return BlobBuilderConstructor;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
})();
|
||||
69
node_modules/blob/package.json
generated
vendored
Normal file
69
node_modules/blob/package.json
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"blob@0.0.2",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "blob@0.0.2",
|
||||
"_id": "blob@0.0.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/blob",
|
||||
"_npmUser": {
|
||||
"email": "tonykovanen@hotmail.com",
|
||||
"name": "rase-"
|
||||
},
|
||||
"_npmVersion": "1.3.5",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "blob",
|
||||
"raw": "blob@0.0.2",
|
||||
"rawSpec": "0.0.2",
|
||||
"scope": null,
|
||||
"spec": "0.0.2",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/blob/-/blob-0.0.2.tgz",
|
||||
"_shasum": "b89562bd6994af95ba1e812155536333aa23cf24",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "blob@0.0.2",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\engine.io-parser",
|
||||
"bugs": {
|
||||
"url": "https://github.com/rase-/blob/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Abstracts out Blob and uses BlobBulder in cases where it is supported with any vendor prefix.",
|
||||
"devDependencies": {
|
||||
"browserify": "3.30.1",
|
||||
"expect.js": "0.2.0",
|
||||
"mocha": "1.17.1",
|
||||
"zuul": "1.5.4"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "b89562bd6994af95ba1e812155536333aa23cf24",
|
||||
"tarball": "http://registry.npmjs.org/blob/-/blob-0.0.2.tgz"
|
||||
},
|
||||
"homepage": "https://github.com/rase-/blob",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tonykovanen@hotmail.com",
|
||||
"name": "rase-"
|
||||
}
|
||||
],
|
||||
"name": "blob",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/rase-/blob.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "0.0.2"
|
||||
}
|
||||
52
node_modules/blob/test/index.js
generated
vendored
Normal file
52
node_modules/blob/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
var Blob = require('../');
|
||||
var expect = require('expect.js');
|
||||
|
||||
if (!Blob) {
|
||||
return;
|
||||
}
|
||||
|
||||
describe('blob', function() {
|
||||
it('should encode a proper sized blob when given a string argument', function() {
|
||||
var b = new Blob(['hi']);
|
||||
expect(b.size).to.be(2);
|
||||
});
|
||||
|
||||
it('should encode a blob with proper size when given two strings as arguments', function() {
|
||||
var b = new Blob(['hi', 'hello']);
|
||||
expect(b.size).to.be(7);
|
||||
});
|
||||
|
||||
it('should encode arraybuffers with right content', function() {
|
||||
var ary = new Uint8Array(5);
|
||||
for (var i = 0; i < 5; i++) ary[i] = i;
|
||||
var b = new Blob([ary.buffer]);
|
||||
var fr = new FileReader();
|
||||
fr.onload = function() {
|
||||
var newAry = new Uint8Array(this.result);
|
||||
for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
|
||||
};
|
||||
});
|
||||
|
||||
it('should encode with blobs', function() {
|
||||
var ary = new Uint8Array(5);
|
||||
for (var i = 0; i < 5; i++) ary[i] = i;
|
||||
var b = new Blob([new Blob([ary.buffer])]);
|
||||
var fr = new FileReader();
|
||||
fr.onload = function() {
|
||||
var newAry = new Uint8Array(this.result);
|
||||
for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
|
||||
};
|
||||
});
|
||||
|
||||
it('should enode mixed contents to right size', function() {
|
||||
var ary = new Uint8Array(5);
|
||||
for (var i = 0; i < 5; i++) ary[i] = i;
|
||||
var b = new Blob([ary.buffer, 'hello']);
|
||||
expect(b.size).to.be(10);
|
||||
});
|
||||
|
||||
it('should accept mime type', function() {
|
||||
var b = new Blob(['hi', 'hello'], { type: 'text/html' });
|
||||
expect(b.type).to.be('text/html');
|
||||
});
|
||||
});
|
||||
1
node_modules/buffer-crc32/.npmignore
generated
vendored
Normal file
1
node_modules/buffer-crc32/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
8
node_modules/buffer-crc32/.travis.yml
generated
vendored
Normal file
8
node_modules/buffer-crc32/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- brianloveswords@gmail.com
|
||||
47
node_modules/buffer-crc32/README.md
generated
vendored
Normal file
47
node_modules/buffer-crc32/README.md
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# buffer-crc32
|
||||
|
||||
[](http://travis-ci.org/brianloveswords/buffer-crc32)
|
||||
|
||||
crc32 that works with binary data and fancy character sets, outputs
|
||||
buffer, signed or unsigned data and has tests.
|
||||
|
||||
Derived from the sample CRC implementation in the PNG specification: http://www.w3.org/TR/PNG/#D-CRCAppendix
|
||||
|
||||
# install
|
||||
```
|
||||
npm install buffer-crc32
|
||||
```
|
||||
|
||||
# example
|
||||
```js
|
||||
var crc32 = require('buffer-crc32');
|
||||
// works with buffers
|
||||
var buf = Buffer([0x00, 0x73, 0x75, 0x70, 0x20, 0x62, 0x72, 0x6f, 0x00])
|
||||
crc32(buf) // -> <Buffer 94 5a ab 4a>
|
||||
|
||||
// has convenience methods for getting signed or unsigned ints
|
||||
crc32.signed(buf) // -> -1805997238
|
||||
crc32.unsigned(buf) // -> 2488970058
|
||||
|
||||
// will cast to buffer if given a string, so you can
|
||||
// directly use foreign characters safely
|
||||
crc32('自動販売機') // -> <Buffer cb 03 1a c5>
|
||||
|
||||
// and works in append mode too
|
||||
var partialCrc = crc32('hey');
|
||||
var partialCrc = crc32(' ', partialCrc);
|
||||
var partialCrc = crc32('sup', partialCrc);
|
||||
var partialCrc = crc32(' ', partialCrc);
|
||||
var finalCrc = crc32('bros', partialCrc); // -> <Buffer 47 fa 55 70>
|
||||
```
|
||||
|
||||
# tests
|
||||
This was tested against the output of zlib's crc32 method. You can run
|
||||
the tests with`npm test` (requires tap)
|
||||
|
||||
# see also
|
||||
https://github.com/alexgorbatchev/node-crc, `crc.buffer.crc32` also
|
||||
supports buffer inputs and return unsigned ints (thanks @tjholowaychuk).
|
||||
|
||||
# license
|
||||
MIT/X11
|
||||
88
node_modules/buffer-crc32/index.js
generated
vendored
Normal file
88
node_modules/buffer-crc32/index.js
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
var Buffer = require('buffer').Buffer;
|
||||
|
||||
var CRC_TABLE = [
|
||||
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
|
||||
0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
|
||||
0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
|
||||
0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
|
||||
0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
|
||||
0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
|
||||
0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
|
||||
0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
|
||||
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
|
||||
0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
|
||||
0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
|
||||
0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
|
||||
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
|
||||
0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
|
||||
0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
|
||||
0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
|
||||
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
|
||||
0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
|
||||
0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
|
||||
0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
|
||||
0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
|
||||
0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
|
||||
0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
|
||||
0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
|
||||
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
|
||||
0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
|
||||
0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
|
||||
0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
|
||||
0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
|
||||
0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
|
||||
0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
|
||||
0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
|
||||
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
|
||||
0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
|
||||
0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
|
||||
0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
|
||||
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
|
||||
0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
|
||||
0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
|
||||
0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
|
||||
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
|
||||
0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
|
||||
0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
|
||||
0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
|
||||
0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
|
||||
0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
|
||||
0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
|
||||
0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
|
||||
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
|
||||
0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
|
||||
0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
|
||||
0x2d02ef8d
|
||||
];
|
||||
|
||||
function bufferizeInt(num) {
|
||||
var tmp = Buffer(4);
|
||||
tmp.writeInt32BE(num, 0);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
function _crc32(buf, previous) {
|
||||
if (!Buffer.isBuffer(buf)) {
|
||||
buf = Buffer(buf);
|
||||
}
|
||||
if (Buffer.isBuffer(previous)) {
|
||||
previous = previous.readUInt32BE(0);
|
||||
}
|
||||
var crc = ~~previous ^ -1;
|
||||
for (var n = 0; n < buf.length; n++) {
|
||||
crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8);
|
||||
}
|
||||
return (crc ^ -1);
|
||||
}
|
||||
|
||||
function crc32() {
|
||||
return bufferizeInt(_crc32.apply(null, arguments));
|
||||
}
|
||||
crc32.signed = function () {
|
||||
return _crc32.apply(null, arguments);
|
||||
};
|
||||
crc32.unsigned = function () {
|
||||
return _crc32.apply(null, arguments) >>> 0;
|
||||
};
|
||||
|
||||
module.exports = crc32;
|
||||
81
node_modules/buffer-crc32/package.json
generated
vendored
Normal file
81
node_modules/buffer-crc32/package.json
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"buffer-crc32@0.2.1",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\express"
|
||||
]
|
||||
],
|
||||
"_from": "buffer-crc32@0.2.1",
|
||||
"_id": "buffer-crc32@0.2.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/buffer-crc32",
|
||||
"_npmUser": {
|
||||
"email": "brian@nyhacker.org",
|
||||
"name": "brianloveswords"
|
||||
},
|
||||
"_npmVersion": "1.1.65",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "buffer-crc32",
|
||||
"raw": "buffer-crc32@0.2.1",
|
||||
"rawSpec": "0.2.1",
|
||||
"scope": null,
|
||||
"spec": "0.2.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/connect",
|
||||
"/express"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz",
|
||||
"_shasum": "be3e5382fc02b6d6324956ac1af98aa98b08534c",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "buffer-crc32@0.2.1",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\express",
|
||||
"author": {
|
||||
"email": "brianloveswords@gmail.com",
|
||||
"name": "Brian J. Brennan",
|
||||
"url": "http://bjb.io"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/brianloveswords/buffer-crc32/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Vladimir Kuznetsov"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "A pure javascript CRC32 algorithm that plays nice with binary data",
|
||||
"devDependencies": {
|
||||
"tap": "~0.2.5"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "be3e5382fc02b6d6324956ac1af98aa98b08534c",
|
||||
"tarball": "http://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"homepage": "https://github.com/brianloveswords/buffer-crc32",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "brian@nyhacker.org",
|
||||
"name": "brianloveswords"
|
||||
}
|
||||
],
|
||||
"name": "buffer-crc32",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/brianloveswords/buffer-crc32.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "./node_modules/.bin/tap tests/*.test.js"
|
||||
},
|
||||
"version": "0.2.1"
|
||||
}
|
||||
89
node_modules/buffer-crc32/tests/crc.test.js
generated
vendored
Normal file
89
node_modules/buffer-crc32/tests/crc.test.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
var crc32 = require('..');
|
||||
var test = require('tap').test;
|
||||
|
||||
test('simple crc32 is no problem', function (t) {
|
||||
var input = Buffer('hey sup bros');
|
||||
var expected = Buffer([0x47, 0xfa, 0x55, 0x70]);
|
||||
t.same(crc32(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('another simple one', function (t) {
|
||||
var input = Buffer('IEND');
|
||||
var expected = Buffer([0xae, 0x42, 0x60, 0x82]);
|
||||
t.same(crc32(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('slightly more complex', function (t) {
|
||||
var input = Buffer([0x00, 0x00, 0x00]);
|
||||
var expected = Buffer([0xff, 0x41, 0xd9, 0x12]);
|
||||
t.same(crc32(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('complex crc32 gets calculated like a champ', function (t) {
|
||||
var input = Buffer('शीर्षक');
|
||||
var expected = Buffer([0x17, 0xb8, 0xaf, 0xf1]);
|
||||
t.same(crc32(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('casts to buffer if necessary', function (t) {
|
||||
var input = 'शीर्षक';
|
||||
var expected = Buffer([0x17, 0xb8, 0xaf, 0xf1]);
|
||||
t.same(crc32(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('can do signed', function (t) {
|
||||
var input = 'ham sandwich';
|
||||
var expected = -1891873021;
|
||||
t.same(crc32.signed(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('can do unsigned', function (t) {
|
||||
var input = 'bear sandwich';
|
||||
var expected = 3711466352;
|
||||
t.same(crc32.unsigned(input), expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
||||
test('simple crc32 in append mode', function (t) {
|
||||
var input = [Buffer('hey'), Buffer(' '), Buffer('sup'), Buffer(' '), Buffer('bros')];
|
||||
var expected = Buffer([0x47, 0xfa, 0x55, 0x70]);
|
||||
for (var crc = 0, i = 0; i < input.length; i++) {
|
||||
crc = crc32(input[i], crc);
|
||||
}
|
||||
t.same(crc, expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
||||
test('can do signed in append mode', function (t) {
|
||||
var input1 = 'ham';
|
||||
var input2 = ' ';
|
||||
var input3 = 'sandwich';
|
||||
var expected = -1891873021;
|
||||
|
||||
var crc = crc32.signed(input1);
|
||||
crc = crc32.signed(input2, crc);
|
||||
crc = crc32.signed(input3, crc);
|
||||
|
||||
t.same(crc, expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('can do unsigned in append mode', function (t) {
|
||||
var input1 = 'bear san';
|
||||
var input2 = 'dwich';
|
||||
var expected = 3711466352;
|
||||
|
||||
var crc = crc32.unsigned(input1);
|
||||
crc = crc32.unsigned(input2, crc);
|
||||
t.same(crc, expected);
|
||||
t.end();
|
||||
});
|
||||
|
||||
1
node_modules/bytes/.npmignore
generated
vendored
Normal file
1
node_modules/bytes/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
test
|
||||
10
node_modules/bytes/History.md
generated
vendored
Normal file
10
node_modules/bytes/History.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
0.2.0 / 2012-10-28
|
||||
==================
|
||||
|
||||
* bytes(200).should.eql('200b')
|
||||
|
||||
0.1.0 / 2012-07-04
|
||||
==================
|
||||
|
||||
* add bytes to string conversion [yields]
|
||||
7
node_modules/bytes/Makefile
generated
vendored
Normal file
7
node_modules/bytes/Makefile
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/mocha \
|
||||
--reporter spec \
|
||||
--require should
|
||||
|
||||
.PHONY: test
|
||||
51
node_modules/bytes/Readme.md
generated
vendored
Normal file
51
node_modules/bytes/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
# node-bytes
|
||||
|
||||
Byte string parser / formatter.
|
||||
|
||||
## Example:
|
||||
|
||||
```js
|
||||
bytes('1kb')
|
||||
// => 1024
|
||||
|
||||
bytes('2mb')
|
||||
// => 2097152
|
||||
|
||||
bytes('1gb')
|
||||
// => 1073741824
|
||||
|
||||
bytes(1073741824)
|
||||
// => 1gb
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ npm install bytes
|
||||
$ component install visionmedia/bytes.js
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
||||
7
node_modules/bytes/component.json
generated
vendored
Normal file
7
node_modules/bytes/component.json
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "bytes",
|
||||
"description": "byte size string parser / serializer",
|
||||
"keywords": ["bytes", "utility"],
|
||||
"version": "0.1.0",
|
||||
"scripts": ["index.js"]
|
||||
}
|
||||
39
node_modules/bytes/index.js
generated
vendored
Normal file
39
node_modules/bytes/index.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
/**
|
||||
* Parse byte `size` string.
|
||||
*
|
||||
* @param {String} size
|
||||
* @return {Number}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function(size) {
|
||||
if ('number' == typeof size) return convert(size);
|
||||
var parts = size.match(/^(\d+(?:\.\d+)?) *(kb|mb|gb)$/)
|
||||
, n = parseFloat(parts[1])
|
||||
, type = parts[2];
|
||||
|
||||
var map = {
|
||||
kb: 1 << 10
|
||||
, mb: 1 << 20
|
||||
, gb: 1 << 30
|
||||
};
|
||||
|
||||
return map[type] * n;
|
||||
};
|
||||
|
||||
/**
|
||||
* convert bytes into string.
|
||||
*
|
||||
* @param {Number} b - bytes to convert
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function convert (b) {
|
||||
var gb = 1 << 30, mb = 1 << 20, kb = 1 << 10;
|
||||
if (b >= gb) return (Math.round(b / gb * 100) / 100) + 'gb';
|
||||
if (b >= mb) return (Math.round(b / mb * 100) / 100) + 'mb';
|
||||
if (b >= kb) return (Math.round(b / kb * 100) / 100) + 'kb';
|
||||
return b + 'b';
|
||||
}
|
||||
62
node_modules/bytes/package.json
generated
vendored
Normal file
62
node_modules/bytes/package.json
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"bytes@0.2.0",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\connect"
|
||||
]
|
||||
],
|
||||
"_from": "bytes@0.2.0",
|
||||
"_id": "bytes@0.2.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/bytes",
|
||||
"_npmUser": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
},
|
||||
"_npmVersion": "1.1.64",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "bytes",
|
||||
"raw": "bytes@0.2.0",
|
||||
"rawSpec": "0.2.0",
|
||||
"scope": null,
|
||||
"spec": "0.2.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/connect"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz",
|
||||
"_shasum": "aad33ec14e3dc2ca74e8e7d451f9ba053ad4f7a0",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "bytes@0.2.0",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\connect",
|
||||
"author": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "TJ Holowaychuk",
|
||||
"url": "http://tjholowaychuk.com"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "byte size string parser / serializer",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "aad33ec14e3dc2ca74e8e7d451f9ba053ad4f7a0",
|
||||
"tarball": "http://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz"
|
||||
},
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
}
|
||||
],
|
||||
"name": "bytes",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"version": "0.2.0"
|
||||
}
|
||||
4
node_modules/callsite/.npmignore
generated
vendored
Normal file
4
node_modules/callsite/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
*.sock
|
||||
10
node_modules/callsite/History.md
generated
vendored
Normal file
10
node_modules/callsite/History.md
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
1.0.0 / 2013-01-24
|
||||
==================
|
||||
|
||||
* remove lame magical getters
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
6
node_modules/callsite/Makefile
generated
vendored
Normal file
6
node_modules/callsite/Makefile
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/mocha \
|
||||
--require should
|
||||
|
||||
.PHONY: test
|
||||
44
node_modules/callsite/Readme.md
generated
vendored
Normal file
44
node_modules/callsite/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
# callstack
|
||||
|
||||
Access to v8's "raw" `CallSite`s.
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install callsite
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var stack = require('callsite');
|
||||
|
||||
foo();
|
||||
|
||||
function foo() {
|
||||
bar();
|
||||
}
|
||||
|
||||
function bar() {
|
||||
baz();
|
||||
}
|
||||
|
||||
function baz() {
|
||||
console.log();
|
||||
stack().forEach(function(site){
|
||||
console.log(' \033[36m%s\033[90m in %s:%d\033[0m'
|
||||
, site.getFunctionName() || 'anonymous'
|
||||
, site.getFileName()
|
||||
, site.getLineNumber());
|
||||
});
|
||||
console.log();
|
||||
}
|
||||
```
|
||||
|
||||
## Why?
|
||||
|
||||
Because you can do weird, stupid, clever, wacky things such as:
|
||||
|
||||
- [better-assert](https://github.com/visionmedia/better-assert)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
10
node_modules/callsite/index.js
generated
vendored
Normal file
10
node_modules/callsite/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
module.exports = function(){
|
||||
var orig = Error.prepareStackTrace;
|
||||
Error.prepareStackTrace = function(_, stack){ return stack; };
|
||||
var err = new Error;
|
||||
Error.captureStackTrace(err, arguments.callee);
|
||||
var stack = err.stack;
|
||||
Error.prepareStackTrace = orig;
|
||||
return stack;
|
||||
};
|
||||
69
node_modules/callsite/package.json
generated
vendored
Normal file
69
node_modules/callsite/package.json
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"callsite@1.0.0",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\better-assert"
|
||||
]
|
||||
],
|
||||
"_from": "callsite@1.0.0",
|
||||
"_id": "callsite@1.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/callsite",
|
||||
"_npmUser": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
},
|
||||
"_npmVersion": "1.2.2",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "callsite",
|
||||
"raw": "callsite@1.0.0",
|
||||
"rawSpec": "1.0.0",
|
||||
"scope": null,
|
||||
"spec": "1.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/better-assert"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
|
||||
"_shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "callsite@1.0.0",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\better-assert",
|
||||
"author": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "TJ Holowaychuk"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "access to v8's CallSites",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20",
|
||||
"tarball": "http://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"stack",
|
||||
"trace",
|
||||
"line"
|
||||
],
|
||||
"main": "index",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
}
|
||||
],
|
||||
"name": "callsite",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
4
node_modules/commander/.npmignore
generated
vendored
Normal file
4
node_modules/commander/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
*.sock
|
||||
4
node_modules/commander/.travis.yml
generated
vendored
Normal file
4
node_modules/commander/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.4
|
||||
- 0.6
|
||||
107
node_modules/commander/History.md
generated
vendored
Normal file
107
node_modules/commander/History.md
generated
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
|
||||
0.6.1 / 2012-06-01
|
||||
==================
|
||||
|
||||
* Added: append (yes or no) on confirmation
|
||||
* Added: allow node.js v0.7.x
|
||||
|
||||
0.6.0 / 2012-04-10
|
||||
==================
|
||||
|
||||
* Added `.prompt(obj, callback)` support. Closes #49
|
||||
* Added default support to .choose(). Closes #41
|
||||
* Fixed the choice example
|
||||
|
||||
0.5.1 / 2011-12-20
|
||||
==================
|
||||
|
||||
* Fixed `password()` for recent nodes. Closes #36
|
||||
|
||||
0.5.0 / 2011-12-04
|
||||
==================
|
||||
|
||||
* Added sub-command option support [itay]
|
||||
|
||||
0.4.3 / 2011-12-04
|
||||
==================
|
||||
|
||||
* Fixed custom help ordering. Closes #32
|
||||
|
||||
0.4.2 / 2011-11-24
|
||||
==================
|
||||
|
||||
* Added travis support
|
||||
* Fixed: line-buffered input automatically trimmed. Closes #31
|
||||
|
||||
0.4.1 / 2011-11-18
|
||||
==================
|
||||
|
||||
* Removed listening for "close" on --help
|
||||
|
||||
0.4.0 / 2011-11-15
|
||||
==================
|
||||
|
||||
* Added support for `--`. Closes #24
|
||||
|
||||
0.3.3 / 2011-11-14
|
||||
==================
|
||||
|
||||
* Fixed: wait for close event when writing help info [Jerry Hamlet]
|
||||
|
||||
0.3.2 / 2011-11-01
|
||||
==================
|
||||
|
||||
* Fixed long flag definitions with values [felixge]
|
||||
|
||||
0.3.1 / 2011-10-31
|
||||
==================
|
||||
|
||||
* Changed `--version` short flag to `-V` from `-v`
|
||||
* Changed `.version()` so it's configurable [felixge]
|
||||
|
||||
0.3.0 / 2011-10-31
|
||||
==================
|
||||
|
||||
* Added support for long flags only. Closes #18
|
||||
|
||||
0.2.1 / 2011-10-24
|
||||
==================
|
||||
|
||||
* "node": ">= 0.4.x < 0.7.0". Closes #20
|
||||
|
||||
0.2.0 / 2011-09-26
|
||||
==================
|
||||
|
||||
* Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
|
||||
|
||||
0.1.0 / 2011-08-24
|
||||
==================
|
||||
|
||||
* Added support for custom `--help` output
|
||||
|
||||
0.0.5 / 2011-08-18
|
||||
==================
|
||||
|
||||
* Changed: when the user enters nothing prompt for password again
|
||||
* Fixed issue with passwords beginning with numbers [NuckChorris]
|
||||
|
||||
0.0.4 / 2011-08-15
|
||||
==================
|
||||
|
||||
* Fixed `Commander#args`
|
||||
|
||||
0.0.3 / 2011-08-15
|
||||
==================
|
||||
|
||||
* Added default option value support
|
||||
|
||||
0.0.2 / 2011-08-15
|
||||
==================
|
||||
|
||||
* Added mask support to `Command#password(str[, mask], fn)`
|
||||
* Added `Command#password(str, fn)`
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
7
node_modules/commander/Makefile
generated
vendored
Normal file
7
node_modules/commander/Makefile
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
TESTS = $(shell find test/test.*.js)
|
||||
|
||||
test:
|
||||
@./test/run $(TESTS)
|
||||
|
||||
.PHONY: test
|
||||
262
node_modules/commander/Readme.md
generated
vendored
Normal file
262
node_modules/commander/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,262 @@
|
||||
# Commander.js
|
||||
|
||||
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
|
||||
|
||||
[](http://travis-ci.org/visionmedia/commander.js)
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install commander
|
||||
|
||||
## Option parsing
|
||||
|
||||
Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
|
||||
|
||||
```js
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var program = require('commander');
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.option('-p, --peppers', 'Add peppers')
|
||||
.option('-P, --pineapple', 'Add pineapple')
|
||||
.option('-b, --bbq', 'Add bbq sauce')
|
||||
.option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
|
||||
.parse(process.argv);
|
||||
|
||||
console.log('you ordered a pizza with:');
|
||||
if (program.peppers) console.log(' - peppers');
|
||||
if (program.pineapple) console.log(' - pineappe');
|
||||
if (program.bbq) console.log(' - bbq');
|
||||
console.log(' - %s cheese', program.cheese);
|
||||
```
|
||||
|
||||
Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
|
||||
|
||||
## Automated --help
|
||||
|
||||
The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
|
||||
|
||||
```
|
||||
$ ./examples/pizza --help
|
||||
|
||||
Usage: pizza [options]
|
||||
|
||||
Options:
|
||||
|
||||
-V, --version output the version number
|
||||
-p, --peppers Add peppers
|
||||
-P, --pineapple Add pineappe
|
||||
-b, --bbq Add bbq sauce
|
||||
-c, --cheese <type> Add the specified type of cheese [marble]
|
||||
-h, --help output usage information
|
||||
|
||||
```
|
||||
|
||||
## Coercion
|
||||
|
||||
```js
|
||||
function range(val) {
|
||||
return val.split('..').map(Number);
|
||||
}
|
||||
|
||||
function list(val) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.usage('[options] <file ...>')
|
||||
.option('-i, --integer <n>', 'An integer argument', parseInt)
|
||||
.option('-f, --float <n>', 'A float argument', parseFloat)
|
||||
.option('-r, --range <a>..<b>', 'A range', range)
|
||||
.option('-l, --list <items>', 'A list', list)
|
||||
.option('-o, --optional [value]', 'An optional value')
|
||||
.parse(process.argv);
|
||||
|
||||
console.log(' int: %j', program.integer);
|
||||
console.log(' float: %j', program.float);
|
||||
console.log(' optional: %j', program.optional);
|
||||
program.range = program.range || [];
|
||||
console.log(' range: %j..%j', program.range[0], program.range[1]);
|
||||
console.log(' list: %j', program.list);
|
||||
console.log(' args: %j', program.args);
|
||||
```
|
||||
|
||||
## Custom help
|
||||
|
||||
You can display arbitrary `-h, --help` information
|
||||
by listening for "--help". Commander will automatically
|
||||
exit once you are done so that the remainder of your program
|
||||
does not execute causing undesired behaviours, for example
|
||||
in the following executable "stuff" will not output when
|
||||
`--help` is used.
|
||||
|
||||
```js
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var program = require('../');
|
||||
|
||||
function list(val) {
|
||||
return val.split(',').map(Number);
|
||||
}
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.option('-f, --foo', 'enable some foo')
|
||||
.option('-b, --bar', 'enable some bar')
|
||||
.option('-B, --baz', 'enable some baz');
|
||||
|
||||
// must be before .parse() since
|
||||
// node's emit() is immediate
|
||||
|
||||
program.on('--help', function(){
|
||||
console.log(' Examples:');
|
||||
console.log('');
|
||||
console.log(' $ custom-help --help');
|
||||
console.log(' $ custom-help -h');
|
||||
console.log('');
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
console.log('stuff');
|
||||
```
|
||||
|
||||
yielding the following help output:
|
||||
|
||||
```
|
||||
|
||||
Usage: custom-help [options]
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-V, --version output the version number
|
||||
-f, --foo enable some foo
|
||||
-b, --bar enable some bar
|
||||
-B, --baz enable some baz
|
||||
|
||||
Examples:
|
||||
|
||||
$ custom-help --help
|
||||
$ custom-help -h
|
||||
|
||||
```
|
||||
|
||||
## .prompt(msg, fn)
|
||||
|
||||
Single-line prompt:
|
||||
|
||||
```js
|
||||
program.prompt('name: ', function(name){
|
||||
console.log('hi %s', name);
|
||||
});
|
||||
```
|
||||
|
||||
Multi-line prompt:
|
||||
|
||||
```js
|
||||
program.prompt('description:', function(name){
|
||||
console.log('hi %s', name);
|
||||
});
|
||||
```
|
||||
|
||||
Coercion:
|
||||
|
||||
```js
|
||||
program.prompt('Age: ', Number, function(age){
|
||||
console.log('age: %j', age);
|
||||
});
|
||||
```
|
||||
|
||||
```js
|
||||
program.prompt('Birthdate: ', Date, function(date){
|
||||
console.log('date: %s', date);
|
||||
});
|
||||
```
|
||||
|
||||
## .password(msg[, mask], fn)
|
||||
|
||||
Prompt for password without echoing:
|
||||
|
||||
```js
|
||||
program.password('Password: ', function(pass){
|
||||
console.log('got "%s"', pass);
|
||||
process.stdin.destroy();
|
||||
});
|
||||
```
|
||||
|
||||
Prompt for password with mask char "*":
|
||||
|
||||
```js
|
||||
program.password('Password: ', '*', function(pass){
|
||||
console.log('got "%s"', pass);
|
||||
process.stdin.destroy();
|
||||
});
|
||||
```
|
||||
|
||||
## .confirm(msg, fn)
|
||||
|
||||
Confirm with the given `msg`:
|
||||
|
||||
```js
|
||||
program.confirm('continue? ', function(ok){
|
||||
console.log(' got %j', ok);
|
||||
});
|
||||
```
|
||||
|
||||
## .choose(list, fn)
|
||||
|
||||
Let the user choose from a `list`:
|
||||
|
||||
```js
|
||||
var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
|
||||
|
||||
console.log('Choose the coolest pet:');
|
||||
program.choose(list, function(i){
|
||||
console.log('you chose %d "%s"', i, list[i]);
|
||||
});
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [API documentation](http://visionmedia.github.com/commander.js/)
|
||||
- [ascii tables](https://github.com/LearnBoost/cli-table)
|
||||
- [progress bars](https://github.com/visionmedia/node-progress)
|
||||
- [more progress bars](https://github.com/substack/node-multimeter)
|
||||
- [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
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.
|
||||
2
node_modules/commander/index.js
generated
vendored
Normal file
2
node_modules/commander/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
module.exports = require('./lib/commander');
|
||||
1026
node_modules/commander/lib/commander.js
generated
vendored
Normal file
1026
node_modules/commander/lib/commander.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
85
node_modules/commander/package.json
generated
vendored
Normal file
85
node_modules/commander/package.json
generated
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"commander@0.6.1",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\express"
|
||||
]
|
||||
],
|
||||
"_defaultsLoaded": true,
|
||||
"_engineSupported": true,
|
||||
"_from": "commander@0.6.1",
|
||||
"_id": "commander@0.6.1",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/commander",
|
||||
"_nodeVersion": "v0.6.12",
|
||||
"_npmUser": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
},
|
||||
"_npmVersion": "1.1.0-3",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "commander",
|
||||
"raw": "commander@0.6.1",
|
||||
"rawSpec": "0.6.1",
|
||||
"scope": null,
|
||||
"spec": "0.6.1",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express",
|
||||
"/ws"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz",
|
||||
"_shasum": "fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "commander@0.6.1",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\express",
|
||||
"author": {
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "TJ Holowaychuk"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/visionmedia/commander.js/issues"
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "the complete solution for node.js command-line programs",
|
||||
"devDependencies": {
|
||||
"should": ">= 0.0.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "fa68a14f6a945d54dbbe50d8cdb3320e9e3b1a06",
|
||||
"tarball": "http://registry.npmjs.org/commander/-/commander-0.6.1.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.x"
|
||||
},
|
||||
"homepage": "https://github.com/visionmedia/commander.js#readme",
|
||||
"keywords": [
|
||||
"command",
|
||||
"option",
|
||||
"parser",
|
||||
"prompt",
|
||||
"stdin"
|
||||
],
|
||||
"main": "index",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tj@vision-media.ca",
|
||||
"name": "tjholowaychuk"
|
||||
}
|
||||
],
|
||||
"name": "commander",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/visionmedia/commander.js.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "0.6.1"
|
||||
}
|
||||
4
node_modules/component-bind/.npmignore
generated
vendored
Normal file
4
node_modules/component-bind/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
support
|
||||
test
|
||||
examples
|
||||
*.sock
|
||||
13
node_modules/component-bind/History.md
generated
vendored
Normal file
13
node_modules/component-bind/History.md
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
1.0.0 / 2014-05-27
|
||||
==================
|
||||
|
||||
* index: use slice ref (#7, @viatropos)
|
||||
* package: rename package to "component-bind"
|
||||
* package: add "repository" field (#6, @repoify)
|
||||
* package: add "component" section
|
||||
|
||||
0.0.1 / 2010-01-03
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
7
node_modules/component-bind/Makefile
generated
vendored
Normal file
7
node_modules/component-bind/Makefile
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/mocha \
|
||||
--require should \
|
||||
--reporter spec
|
||||
|
||||
.PHONY: test
|
||||
64
node_modules/component-bind/Readme.md
generated
vendored
Normal file
64
node_modules/component-bind/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
# bind
|
||||
|
||||
Function binding utility.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ component install component/bind
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
- [bind(obj, fn)](#bindobj-fn)
|
||||
- [bind(obj, fn, ...)](#bindobj-fn-)
|
||||
- [bind(obj, name)](#bindobj-name)
|
||||
<a name=""></a>
|
||||
|
||||
<a name="bindobj-fn"></a>
|
||||
### bind(obj, fn)
|
||||
should bind the function to the given object.
|
||||
|
||||
```js
|
||||
var tobi = { name: 'tobi' };
|
||||
|
||||
function name() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
var fn = bind(tobi, name);
|
||||
fn().should.equal('tobi');
|
||||
```
|
||||
|
||||
<a name="bindobj-fn-"></a>
|
||||
### bind(obj, fn, ...)
|
||||
should curry the remaining arguments.
|
||||
|
||||
```js
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
bind(null, add)(1, 2).should.equal(3);
|
||||
bind(null, add, 1)(2).should.equal(3);
|
||||
bind(null, add, 1, 2)().should.equal(3);
|
||||
```
|
||||
|
||||
<a name="bindobj-name"></a>
|
||||
### bind(obj, name)
|
||||
should bind the method of the given name.
|
||||
|
||||
```js
|
||||
var tobi = { name: 'tobi' };
|
||||
|
||||
tobi.getName = function() {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
var fn = bind(tobi, 'getName');
|
||||
fn().should.equal('tobi');
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
13
node_modules/component-bind/component.json
generated
vendored
Normal file
13
node_modules/component-bind/component.json
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "bind",
|
||||
"version": "1.0.0",
|
||||
"description": "function binding utility",
|
||||
"keywords": [
|
||||
"bind",
|
||||
"utility"
|
||||
],
|
||||
"dependencies": {},
|
||||
"scripts": [
|
||||
"index.js"
|
||||
]
|
||||
}
|
||||
23
node_modules/component-bind/index.js
generated
vendored
Normal file
23
node_modules/component-bind/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Slice reference.
|
||||
*/
|
||||
|
||||
var slice = [].slice;
|
||||
|
||||
/**
|
||||
* Bind `obj` to `fn`.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @param {Function|String} fn or string
|
||||
* @return {Function}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function(obj, fn){
|
||||
if ('string' == typeof fn) fn = obj[fn];
|
||||
if ('function' != typeof fn) throw new Error('bind() requires a function');
|
||||
var args = slice.call(arguments, 2);
|
||||
return function(){
|
||||
return fn.apply(obj, args.concat(slice.call(arguments)));
|
||||
}
|
||||
};
|
||||
73
node_modules/component-bind/package.json
generated
vendored
Normal file
73
node_modules/component-bind/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"component-bind@1.0.0",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-client"
|
||||
]
|
||||
],
|
||||
"_from": "component-bind@1.0.0",
|
||||
"_id": "component-bind@1.0.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/component-bind",
|
||||
"_npmUser": {
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "tootallnate"
|
||||
},
|
||||
"_npmVersion": "1.4.9",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "component-bind",
|
||||
"raw": "component-bind@1.0.0",
|
||||
"rawSpec": "1.0.0",
|
||||
"scope": null,
|
||||
"spec": "1.0.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/socket.io-client"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
|
||||
"_shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "component-bind@1.0.0",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-client",
|
||||
"bugs": {
|
||||
"url": "https://github.com/component/bind/issues"
|
||||
},
|
||||
"component": {
|
||||
"scripts": {
|
||||
"bind/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "function binding utility",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1",
|
||||
"tarball": "http://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz"
|
||||
},
|
||||
"homepage": "https://github.com/component/bind",
|
||||
"keywords": [
|
||||
"bind",
|
||||
"utility"
|
||||
],
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "tootallnate"
|
||||
}
|
||||
],
|
||||
"name": "component-bind",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/component/bind.git"
|
||||
},
|
||||
"version": "1.0.0"
|
||||
}
|
||||
2
node_modules/component-emitter/.npmignore
generated
vendored
Normal file
2
node_modules/component-emitter/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
test
|
||||
4
node_modules/component-emitter/.travis.yml
generated
vendored
Normal file
4
node_modules/component-emitter/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
node_js:
|
||||
- "0.8"
|
||||
- "0.10"
|
||||
language: node_js
|
||||
52
node_modules/component-emitter/History.md
generated
vendored
Normal file
52
node_modules/component-emitter/History.md
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
1.1.2 / 2014-02-10
|
||||
==================
|
||||
|
||||
* package: rename to "component-emitter"
|
||||
* package: update "main" and "component" fields
|
||||
* Add license to Readme (same format as the other components)
|
||||
* created .npmignore
|
||||
* travis stuff
|
||||
|
||||
1.1.1 / 2013-12-01
|
||||
==================
|
||||
|
||||
* fix .once adding .on to the listener
|
||||
* docs: Emitter#off()
|
||||
* component: add `.repo` prop
|
||||
|
||||
1.1.0 / 2013-10-20
|
||||
==================
|
||||
|
||||
* add `.addEventListener()` and `.removeEventListener()` aliases
|
||||
|
||||
1.0.1 / 2013-06-27
|
||||
==================
|
||||
|
||||
* add support for legacy ie
|
||||
|
||||
1.0.0 / 2013-02-26
|
||||
==================
|
||||
|
||||
* add `.off()` support for removing all listeners
|
||||
|
||||
0.0.6 / 2012-10-08
|
||||
==================
|
||||
|
||||
* add `this._callbacks` initialization to prevent funky gotcha
|
||||
|
||||
0.0.5 / 2012-09-07
|
||||
==================
|
||||
|
||||
* fix `Emitter.call(this)` usage
|
||||
|
||||
0.0.3 / 2012-07-11
|
||||
==================
|
||||
|
||||
* add `.listeners()`
|
||||
* rename `.has()` to `.hasListeners()`
|
||||
|
||||
0.0.2 / 2012-06-28
|
||||
==================
|
||||
|
||||
* fix `.off()` with `.once()`-registered callbacks
|
||||
7
node_modules/component-emitter/Makefile
generated
vendored
Normal file
7
node_modules/component-emitter/Makefile
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
test:
|
||||
@./node_modules/.bin/mocha \
|
||||
--require should \
|
||||
--reporter spec
|
||||
|
||||
.PHONY: test
|
||||
74
node_modules/component-emitter/Readme.md
generated
vendored
Normal file
74
node_modules/component-emitter/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
# Emitter [](https://travis-ci.org/component/emitter)
|
||||
|
||||
Event emitter component.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ component install component/emitter
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### Emitter(obj)
|
||||
|
||||
The `Emitter` may also be used as a mixin. For example
|
||||
a "plain" object may become an emitter, or you may
|
||||
extend an existing prototype.
|
||||
|
||||
As an `Emitter` instance:
|
||||
|
||||
```js
|
||||
var Emitter = require('emitter');
|
||||
var emitter = new Emitter;
|
||||
emitter.emit('something');
|
||||
```
|
||||
|
||||
As a mixin:
|
||||
|
||||
```js
|
||||
var Emitter = require('emitter');
|
||||
var user = { name: 'tobi' };
|
||||
Emitter(user);
|
||||
|
||||
user.emit('im a user');
|
||||
```
|
||||
|
||||
As a prototype mixin:
|
||||
|
||||
```js
|
||||
var Emitter = require('emitter');
|
||||
Emitter(User.prototype);
|
||||
```
|
||||
|
||||
### Emitter#on(event, fn)
|
||||
|
||||
Register an `event` handler `fn`.
|
||||
|
||||
### Emitter#once(event, fn)
|
||||
|
||||
Register a single-shot `event` handler `fn`,
|
||||
removed immediately after it is invoked the
|
||||
first time.
|
||||
|
||||
### Emitter#off(event, fn)
|
||||
|
||||
* Pass `event` and `fn` to remove a listener.
|
||||
* Pass `event` to remove all listeners on that event.
|
||||
* Pass nothing to remove all listeners on all events.
|
||||
|
||||
### Emitter#emit(event, ...)
|
||||
|
||||
Emit an `event` with variable option args.
|
||||
|
||||
### Emitter#listeners(event)
|
||||
|
||||
Return an array of callbacks, or an empty array.
|
||||
|
||||
### Emitter#hasListeners(event)
|
||||
|
||||
Check if this emitter has `event` handlers.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
21
node_modules/component-emitter/bower.json
generated
vendored
Normal file
21
node_modules/component-emitter/bower.json
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "emitter",
|
||||
"description": "Event emitter",
|
||||
"keywords": [
|
||||
"emitter",
|
||||
"events"
|
||||
],
|
||||
"version": "1.1.2",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"homepage": "https://github.com/component/emitter",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"Makefile",
|
||||
"package.json",
|
||||
"component.json"
|
||||
]
|
||||
}
|
||||
14
node_modules/component-emitter/component.json
generated
vendored
Normal file
14
node_modules/component-emitter/component.json
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "emitter",
|
||||
"repo": "component/emitter",
|
||||
"description": "Event emitter",
|
||||
"keywords": [
|
||||
"emitter",
|
||||
"events"
|
||||
],
|
||||
"version": "1.1.2",
|
||||
"scripts": [
|
||||
"index.js"
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
||||
164
node_modules/component-emitter/index.js
generated
vendored
Normal file
164
node_modules/component-emitter/index.js
generated
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
|
||||
/**
|
||||
* Expose `Emitter`.
|
||||
*/
|
||||
|
||||
module.exports = Emitter;
|
||||
|
||||
/**
|
||||
* Initialize a new `Emitter`.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Emitter(obj) {
|
||||
if (obj) return mixin(obj);
|
||||
};
|
||||
|
||||
/**
|
||||
* Mixin the emitter properties.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @return {Object}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function mixin(obj) {
|
||||
for (var key in Emitter.prototype) {
|
||||
obj[key] = Emitter.prototype[key];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen on the given `event` with `fn`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.on =
|
||||
Emitter.prototype.addEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
(this._callbacks[event] = this._callbacks[event] || [])
|
||||
.push(fn);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds an `event` listener that will be invoked a single
|
||||
* time then automatically removed.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.once = function(event, fn){
|
||||
var self = this;
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
function on() {
|
||||
self.off(event, on);
|
||||
fn.apply(this, arguments);
|
||||
}
|
||||
|
||||
on.fn = fn;
|
||||
this.on(event, on);
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Remove the given callback for `event` or all
|
||||
* registered callbacks.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Function} fn
|
||||
* @return {Emitter}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.off =
|
||||
Emitter.prototype.removeListener =
|
||||
Emitter.prototype.removeAllListeners =
|
||||
Emitter.prototype.removeEventListener = function(event, fn){
|
||||
this._callbacks = this._callbacks || {};
|
||||
|
||||
// all
|
||||
if (0 == arguments.length) {
|
||||
this._callbacks = {};
|
||||
return this;
|
||||
}
|
||||
|
||||
// specific event
|
||||
var callbacks = this._callbacks[event];
|
||||
if (!callbacks) return this;
|
||||
|
||||
// remove all handlers
|
||||
if (1 == arguments.length) {
|
||||
delete this._callbacks[event];
|
||||
return this;
|
||||
}
|
||||
|
||||
// remove specific handler
|
||||
var cb;
|
||||
for (var i = 0; i < callbacks.length; i++) {
|
||||
cb = callbacks[i];
|
||||
if (cb === fn || cb.fn === fn) {
|
||||
callbacks.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Emit `event` with the given args.
|
||||
*
|
||||
* @param {String} event
|
||||
* @param {Mixed} ...
|
||||
* @return {Emitter}
|
||||
*/
|
||||
|
||||
Emitter.prototype.emit = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
var args = [].slice.call(arguments, 1)
|
||||
, callbacks = this._callbacks[event];
|
||||
|
||||
if (callbacks) {
|
||||
callbacks = callbacks.slice(0);
|
||||
for (var i = 0, len = callbacks.length; i < len; ++i) {
|
||||
callbacks[i].apply(this, args);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return array of callbacks for `event`.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.listeners = function(event){
|
||||
this._callbacks = this._callbacks || {};
|
||||
return this._callbacks[event] || [];
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if this emitter has `event` handlers.
|
||||
*
|
||||
* @param {String} event
|
||||
* @return {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Emitter.prototype.hasListeners = function(event){
|
||||
return !! this.listeners(event).length;
|
||||
};
|
||||
75
node_modules/component-emitter/package.json
generated
vendored
Normal file
75
node_modules/component-emitter/package.json
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"component-emitter@1.1.2",
|
||||
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-parser"
|
||||
]
|
||||
],
|
||||
"_from": "component-emitter@1.1.2",
|
||||
"_id": "component-emitter@1.1.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/component-emitter",
|
||||
"_npmUser": {
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "tootallnate"
|
||||
},
|
||||
"_npmVersion": "1.3.24",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "component-emitter",
|
||||
"raw": "component-emitter@1.1.2",
|
||||
"rawSpec": "1.1.2",
|
||||
"scope": null,
|
||||
"spec": "1.1.2",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/engine.io-client",
|
||||
"/socket.io-client",
|
||||
"/socket.io-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz",
|
||||
"_shasum": "296594f2753daa63996d2af08d15a95116c9aec3",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "component-emitter@1.1.2",
|
||||
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\socket.io-parser",
|
||||
"bugs": {
|
||||
"url": "https://github.com/component/emitter/issues"
|
||||
},
|
||||
"component": {
|
||||
"scripts": {
|
||||
"emitter/index.js": "index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {},
|
||||
"description": "Event emitter",
|
||||
"devDependencies": {
|
||||
"mocha": "*",
|
||||
"should": "*"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "296594f2753daa63996d2af08d15a95116c9aec3",
|
||||
"tarball": "http://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz"
|
||||
},
|
||||
"homepage": "https://github.com/component/emitter",
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "nathan@tootallnate.net",
|
||||
"name": "tootallnate"
|
||||
}
|
||||
],
|
||||
"name": "component-emitter",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/component/emitter.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "1.1.2"
|
||||
}
|
||||
3
node_modules/component-inherit/.npmignore
generated
vendored
Normal file
3
node_modules/component-inherit/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
components
|
||||
build
|
||||
node_modules
|
||||
5
node_modules/component-inherit/History.md
generated
vendored
Normal file
5
node_modules/component-inherit/History.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
0.0.2 / 2012-09-03
|
||||
==================
|
||||
|
||||
* fix typo in package.json
|
||||
16
node_modules/component-inherit/Makefile
generated
vendored
Normal file
16
node_modules/component-inherit/Makefile
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
build: components index.js
|
||||
@component build
|
||||
|
||||
components:
|
||||
@Component install
|
||||
|
||||
clean:
|
||||
rm -fr build components template.js
|
||||
|
||||
test:
|
||||
@node_modules/.bin/mocha \
|
||||
--require should \
|
||||
--reporter spec
|
||||
|
||||
.PHONY: clean test
|
||||
24
node_modules/component-inherit/Readme.md
generated
vendored
Normal file
24
node_modules/component-inherit/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# inherit
|
||||
|
||||
Prototype inheritance utility.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ component install component/inherit
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var inherit = require('inherit');
|
||||
|
||||
function Human() {}
|
||||
function Woman() {}
|
||||
|
||||
inherit(Woman, Human);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
10
node_modules/component-inherit/component.json
generated
vendored
Normal file
10
node_modules/component-inherit/component.json
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "inherit",
|
||||
"description": "Prototype inheritance utility",
|
||||
"version": "0.0.3",
|
||||
"keywords": ["inherit", "utility"],
|
||||
"dependencies": {},
|
||||
"scripts": [
|
||||
"index.js"
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user