nodejs with express server, leapmotion for movement control, and threejs for 3d render

This commit is contained in:
idoctnef
2016-05-30 18:14:08 +02:00
parent e2aeac1bae
commit 52b63ee33a
893 changed files with 127726 additions and 0 deletions

1
node_modules/cookie/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

5
node_modules/cookie/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,5 @@
language: node_js
node_js:
- "0.6"
- "0.8"
- "0.10"

9
node_modules/cookie/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
// MIT License
Copyright (C) Roman Shtylman <shtylman@gmail.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.

44
node_modules/cookie/README.md generated vendored Normal file
View File

@@ -0,0 +1,44 @@
# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) #
cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers.
See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies.
## how?
```
npm install cookie
```
```javascript
var cookie = require('cookie');
var hdr = cookie.serialize('foo', 'bar');
// hdr = 'foo=bar';
var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff');
// cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' };
```
## more
The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values.
### path
> cookie path
### expires
> absolute expiration date for the cookie (Date object)
### maxAge
> relative max age of the cookie from when the client receives it (seconds)
### domain
> domain for the cookie
### secure
> true or false
### httpOnly
> true or false

70
node_modules/cookie/index.js generated vendored Normal file
View File

@@ -0,0 +1,70 @@
/// Serialize the a name value pair into a cookie string suitable for
/// http headers. An optional options object specified cookie parameters
///
/// serialize('foo', 'bar', { httpOnly: true })
/// => "foo=bar; httpOnly"
///
/// @param {String} name
/// @param {String} val
/// @param {Object} options
/// @return {String}
var serialize = function(name, val, opt){
opt = opt || {};
var enc = opt.encode || encode;
var pairs = [name + '=' + enc(val)];
if (opt.maxAge) pairs.push('Max-Age=' + opt.maxAge);
if (opt.domain) pairs.push('Domain=' + opt.domain);
if (opt.path) pairs.push('Path=' + opt.path);
if (opt.expires) pairs.push('Expires=' + opt.expires.toUTCString());
if (opt.httpOnly) pairs.push('HttpOnly');
if (opt.secure) pairs.push('Secure');
return pairs.join('; ');
};
/// Parse the given cookie header string into an object
/// The object has the various cookies as keys(names) => values
/// @param {String} str
/// @return {Object}
var parse = function(str, opt) {
opt = opt || {};
var obj = {}
var pairs = str.split(/[;,] */);
var dec = opt.decode || decode;
pairs.forEach(function(pair) {
var eq_idx = pair.indexOf('=')
// skip things that don't look like key=value
if (eq_idx < 0) {
return;
}
var key = pair.substr(0, eq_idx).trim()
var val = pair.substr(++eq_idx, pair.length).trim();
// quoted values
if ('"' == val[0]) {
val = val.slice(1, -1);
}
// only assign once
if (undefined == obj[key]) {
try {
obj[key] = dec(val);
} catch (e) {
obj[key] = val;
}
}
});
return obj;
};
var encode = encodeURIComponent;
var decode = decodeURIComponent;
module.exports.serialize = serialize;
module.exports.parse = parse;

78
node_modules/cookie/package.json generated vendored Normal file
View File

@@ -0,0 +1,78 @@
{
"_args": [
[
"cookie@0.1.0",
"C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\express"
]
],
"_from": "cookie@0.1.0",
"_id": "cookie@0.1.0",
"_inCache": true,
"_installable": true,
"_location": "/cookie",
"_npmUser": {
"email": "shtylman@gmail.com",
"name": "shtylman"
},
"_npmVersion": "1.2.18",
"_phantomChildren": {},
"_requested": {
"name": "cookie",
"raw": "cookie@0.1.0",
"rawSpec": "0.1.0",
"scope": null,
"spec": "0.1.0",
"type": "version"
},
"_requiredBy": [
"/express"
],
"_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz",
"_shasum": "90eb469ddce905c866de687efc43131d8801f9d0",
"_shrinkwrap": null,
"_spec": "cookie@0.1.0",
"_where": "C:\\Users\\esanvin\\Desktop\\multi\\NodeServer\\node_modules\\express",
"author": {
"email": "shtylman@gmail.com",
"name": "Roman Shtylman"
},
"bugs": {
"url": "https://github.com/shtylman/node-cookie/issues"
},
"dependencies": {},
"description": "cookie parsing and serialization",
"devDependencies": {
"mocha": "1.x.x"
},
"directories": {},
"dist": {
"shasum": "90eb469ddce905c866de687efc43131d8801f9d0",
"tarball": "http://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz"
},
"engines": {
"node": "*"
},
"homepage": "https://github.com/shtylman/node-cookie#readme",
"keywords": [
"cookie",
"cookies"
],
"main": "index.js",
"maintainers": [
{
"email": "shtylman@gmail.com",
"name": "shtylman"
}
],
"name": "cookie",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/shtylman/node-cookie.git"
},
"scripts": {
"test": "mocha"
},
"version": "0.1.0"
}

1
node_modules/cookie/test/mocha.opts generated vendored Normal file
View File

@@ -0,0 +1 @@
--ui qunit

44
node_modules/cookie/test/parse.js generated vendored Normal file
View File

@@ -0,0 +1,44 @@
var assert = require('assert');
var cookie = require('..');
suite('parse');
test('basic', function() {
assert.deepEqual({ foo: 'bar' }, cookie.parse('foo=bar'));
assert.deepEqual({ foo: '123' }, cookie.parse('foo=123'));
});
test('ignore spaces', function() {
assert.deepEqual({ FOO: 'bar', baz: 'raz' },
cookie.parse('FOO = bar; baz = raz'));
});
test('escaping', function() {
assert.deepEqual({ foo: 'bar=123456789&name=Magic+Mouse' },
cookie.parse('foo="bar=123456789&name=Magic+Mouse"'));
assert.deepEqual({ email: ' ",;/' },
cookie.parse('email=%20%22%2c%3b%2f'));
});
test('ignore escaping error and return original value', function() {
assert.deepEqual({ foo: '%1', bar: 'bar' }, cookie.parse('foo=%1;bar=bar'));
});
test('ignore non values', function() {
assert.deepEqual({ foo: '%1', bar: 'bar' }, cookie.parse('foo=%1;bar=bar;HttpOnly;Secure'));
});
test('unencoded', function() {
assert.deepEqual({ foo: 'bar=123456789&name=Magic+Mouse' },
cookie.parse('foo="bar=123456789&name=Magic+Mouse"',{
decode: function(value) { return value; }
}));
assert.deepEqual({ email: '%20%22%2c%3b%2f' },
cookie.parse('email=%20%22%2c%3b%2f',{
decode: function(value) { return value; }
}));
})

64
node_modules/cookie/test/serialize.js generated vendored Normal file
View File

@@ -0,0 +1,64 @@
// builtin
var assert = require('assert');
var cookie = require('..');
suite('serialize');
test('basic', function() {
assert.equal('foo=bar', cookie.serialize('foo', 'bar'));
assert.equal('foo=bar%20baz', cookie.serialize('foo', 'bar baz'));
});
test('path', function() {
assert.equal('foo=bar; Path=/', cookie.serialize('foo', 'bar', {
path: '/'
}));
});
test('secure', function() {
assert.equal('foo=bar; Secure', cookie.serialize('foo', 'bar', {
secure: true
}));
assert.equal('foo=bar', cookie.serialize('foo', 'bar', {
secure: false
}));
});
test('domain', function() {
assert.equal('foo=bar; Domain=example.com', cookie.serialize('foo', 'bar', {
domain: 'example.com'
}));
});
test('httpOnly', function() {
assert.equal('foo=bar; HttpOnly', cookie.serialize('foo', 'bar', {
httpOnly: true
}));
});
test('maxAge', function() {
assert.equal('foo=bar; Max-Age=1000', cookie.serialize('foo', 'bar', {
maxAge: 1000
}));
});
test('escaping', function() {
assert.deepEqual('cat=%2B%20', cookie.serialize('cat', '+ '));
});
test('parse->serialize', function() {
assert.deepEqual({ cat: 'foo=123&name=baz five' }, cookie.parse(
cookie.serialize('cat', 'foo=123&name=baz five')));
assert.deepEqual({ cat: ' ";/' }, cookie.parse(
cookie.serialize('cat', ' ";/')));
});
test('unencoded', function() {
assert.deepEqual('cat=+ ', cookie.serialize('cat', '+ ', {
encode: function(value) { return value; }
}));
})