Commit 81b3ab31a7d0e04b872e4bce8172a43e21ffbd6a
Exists in
master
and in
1 other branch
Merge branch 'teste1' into devel
Showing
61 changed files
with
437 additions
and
293 deletions
Show diff stats
endpoints/texto.js
| ... | ... | @@ -65,6 +65,7 @@ function init(req, res, Request) { |
| 65 | 65 | |
| 66 | 66 | job.on('complete', function() { |
| 67 | 67 | /* Listener que dispara quando a requisição ao core finaliza */ |
| 68 | + // console.log("JOB complete"); | |
| 68 | 69 | child.on('close', function(code, signal) { |
| 69 | 70 | // res.send(200, { 'response' : 'http://' + properties.SERVER_IP + ':' + properties.port + '/' + id + '.webm' }); |
| 70 | 71 | db.update(request_object, 'Completed', function(result) { | ... | ... |
helpers/queue.js
| 1 | 1 | var exec = require('child_process').exec, child; |
| 2 | 2 | |
| 3 | -exports.exec_command_line = function (command_line, callback) { | |
| 3 | +exports.exec_command_line = function (command_line, done) { | |
| 4 | 4 | |
| 5 | 5 | child = exec(command_line, function(err, stdout, stderr) { |
| 6 | 6 | // console.log('Err: ' + err); |
| 7 | 7 | // console.log('STDOUT: ' + stdout); |
| 8 | 8 | // console.log('STDERR: ' + stderr); |
| 9 | 9 | }); |
| 10 | - //callback(); | |
| 10 | + //done(); | |
| 11 | 11 | // if (child === undefined) { |
| 12 | 12 | // throw "Erro ao conectar com o core"; |
| 13 | 13 | // } |
| ... | ... | @@ -17,6 +17,18 @@ exports.exec_command_line = function (command_line, callback) { |
| 17 | 17 | child.on('disconnect', function(code, signal) { |
| 18 | 18 | throw "Disconectado do core"; |
| 19 | 19 | }); |
| 20 | + | |
| 21 | + // tentar com isso descomentado no lugar de chamar o done() direto | |
| 22 | + // child.on('close', function(code, signal) { | |
| 23 | + // done(); | |
| 24 | + // }); | |
| 25 | + done(); | |
| 20 | 26 | return child; |
| 21 | 27 | |
| 22 | 28 | }; |
| 29 | + | |
| 30 | +// use to debug | |
| 31 | +exports.text = function (text, callback) { | |
| 32 | + console.log("Text inside queue_helper: " + text); | |
| 33 | + return text; | |
| 34 | +}; | ... | ... |
logsystem/errors.log
logsystem/services.log
node_modules/async/.travis.yml
node_modules/async/README.md
| ... | ... | @@ -5,8 +5,16 @@ |
| 5 | 5 | |
| 6 | 6 | Async is a utility module which provides straight-forward, powerful functions |
| 7 | 7 | for working with asynchronous JavaScript. Although originally designed for |
| 8 | -use with [Node.js](http://nodejs.org), it can also be used directly in the | |
| 9 | -browser. Also supports [component](https://github.com/component/component). | |
| 8 | +use with [Node.js](http://nodejs.org) and installable via `npm install async`, | |
| 9 | +it can also be used directly in the browser. | |
| 10 | + | |
| 11 | +Async is also installable via: | |
| 12 | + | |
| 13 | +- [bower](http://bower.io/): `bower install async` | |
| 14 | +- [component](https://github.com/component/component): `component install | |
| 15 | + caolan/async` | |
| 16 | +- [jam](http://jamjs.org/): `jam install async` | |
| 17 | +- [spm](http://spmjs.io/): `spm install async` | |
| 10 | 18 | |
| 11 | 19 | Async provides around 20 functions that include the usual 'functional' |
| 12 | 20 | suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns |
| ... | ... | @@ -182,7 +190,7 @@ __Arguments__ |
| 182 | 190 | * `arr` - An array to iterate over. |
| 183 | 191 | * `iterator(item, callback)` - A function to apply to each item in `arr`. |
| 184 | 192 | The iterator is passed a `callback(err)` which must be called once it has |
| 185 | - completed. If no error has occured, the `callback` should be run without | |
| 193 | + completed. If no error has occurred, the `callback` should be run without | |
| 186 | 194 | arguments or with an explicit `null` argument. |
| 187 | 195 | * `callback(err)` - A callback which is called when all `iterator` functions |
| 188 | 196 | have finished, or an error occurs. |
| ... | ... | @@ -202,7 +210,7 @@ async.each(openFiles, saveFile, function(err){ |
| 202 | 210 | ```js |
| 203 | 211 | // assuming openFiles is an array of file names |
| 204 | 212 | |
| 205 | -async.each(openFiles, function( file, callback) { | |
| 213 | +async.each(openFiles, function(file, callback) { | |
| 206 | 214 | |
| 207 | 215 | // Perform operation on file here. |
| 208 | 216 | console.log('Processing file ' + file); |
| ... | ... | @@ -256,7 +264,7 @@ __Arguments__ |
| 256 | 264 | * `limit` - The maximum number of `iterator`s to run at any time. |
| 257 | 265 | * `iterator(item, callback)` - A function to apply to each item in `arr`. |
| 258 | 266 | The iterator is passed a `callback(err)` which must be called once it has |
| 259 | - completed. If no error has occured, the callback should be run without | |
| 267 | + completed. If no error has occurred, the callback should be run without | |
| 260 | 268 | arguments or with an explicit `null` argument. |
| 261 | 269 | * `callback(err)` - A callback which is called when all `iterator` functions |
| 262 | 270 | have finished, or an error occurs. |
| ... | ... | @@ -280,7 +288,7 @@ async.eachLimit(documents, 20, requestApi, function(err){ |
| 280 | 288 | Produces a new array of values by mapping each value in `arr` through |
| 281 | 289 | the `iterator` function. The `iterator` is called with an item from `arr` and a |
| 282 | 290 | callback for when it has finished processing. Each of these callback takes 2 arguments: |
| 283 | -an `error`, and the transformed item from `arr`. If `iterator` passes an error to this | |
| 291 | +an `error`, and the transformed item from `arr`. If `iterator` passes an error to his | |
| 284 | 292 | callback, the main `callback` (for the `map` function) is immediately called with the error. |
| 285 | 293 | |
| 286 | 294 | Note, that since this function applies the `iterator` to each item in parallel, |
| ... | ... | @@ -536,14 +544,14 @@ By modifying the callback parameter the sorting order can be influenced: |
| 536 | 544 | ```js |
| 537 | 545 | //ascending order |
| 538 | 546 | async.sortBy([1,9,3,5], function(x, callback){ |
| 539 | - callback(err, x); | |
| 547 | + callback(null, x); | |
| 540 | 548 | }, function(err,result){ |
| 541 | 549 | //result callback |
| 542 | 550 | } ); |
| 543 | 551 | |
| 544 | 552 | //descending order |
| 545 | 553 | async.sortBy([1,9,3,5], function(x, callback){ |
| 546 | - callback(err, x*-1); //<- x*-1 instead of x, turns the order around | |
| 554 | + callback(null, x*-1); //<- x*-1 instead of x, turns the order around | |
| 547 | 555 | }, function(err,result){ |
| 548 | 556 | //result callback |
| 549 | 557 | } ); |
| ... | ... | @@ -913,19 +921,19 @@ __Example__ |
| 913 | 921 | |
| 914 | 922 | ```js |
| 915 | 923 | async.waterfall([ |
| 916 | - function(callback){ | |
| 924 | + function(callback) { | |
| 917 | 925 | callback(null, 'one', 'two'); |
| 918 | 926 | }, |
| 919 | - function(arg1, arg2, callback){ | |
| 927 | + function(arg1, arg2, callback) { | |
| 920 | 928 | // arg1 now equals 'one' and arg2 now equals 'two' |
| 921 | 929 | callback(null, 'three'); |
| 922 | 930 | }, |
| 923 | - function(arg1, callback){ | |
| 931 | + function(arg1, callback) { | |
| 924 | 932 | // arg1 now equals 'three' |
| 925 | 933 | callback(null, 'done'); |
| 926 | 934 | } |
| 927 | 935 | ], function (err, result) { |
| 928 | - // result now equals 'done' | |
| 936 | + // result now equals 'done' | |
| 929 | 937 | }); |
| 930 | 938 | ``` |
| 931 | 939 | |
| ... | ... | @@ -972,7 +980,8 @@ add1mul3(4, function (err, result) { |
| 972 | 980 | ### seq(fn1, fn2...) |
| 973 | 981 | |
| 974 | 982 | Version of the compose function that is more natural to read. |
| 975 | -Each following function consumes the return value of the latter function. | |
| 983 | +Each function consumes the return value of the previous function. | |
| 984 | +It is the equivalent of [`compose`](#compose) with the arguments reversed. | |
| 976 | 985 | |
| 977 | 986 | Each function is executed with the `this` binding of the composed function. |
| 978 | 987 | |
| ... | ... | @@ -989,28 +998,20 @@ __Example__ |
| 989 | 998 | // This example uses `seq` function to avoid overnesting and error |
| 990 | 999 | // handling clutter. |
| 991 | 1000 | app.get('/cats', function(request, response) { |
| 992 | - function handleError(err, data, callback) { | |
| 993 | - if (err) { | |
| 994 | - console.error(err); | |
| 995 | - response.json({ status: 'error', message: err.message }); | |
| 996 | - } | |
| 997 | - else { | |
| 998 | - callback(data); | |
| 999 | - } | |
| 1000 | - } | |
| 1001 | 1001 | var User = request.models.User; |
| 1002 | 1002 | async.seq( |
| 1003 | 1003 | _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) |
| 1004 | - handleError, | |
| 1005 | 1004 | function(user, fn) { |
| 1006 | 1005 | user.getCats(fn); // 'getCats' has signature (callback(err, data)) |
| 1007 | - }, | |
| 1008 | - handleError, | |
| 1009 | - function(cats) { | |
| 1006 | + } | |
| 1007 | + )(req.session.user_id, function (err, cats) { | |
| 1008 | + if (err) { | |
| 1009 | + console.error(err); | |
| 1010 | + response.json({ status: 'error', message: err.message }); | |
| 1011 | + } else { | |
| 1010 | 1012 | response.json({ status: 'ok', message: 'Cats found', data: cats }); |
| 1011 | 1013 | } |
| 1012 | - )(req.session.user_id); | |
| 1013 | - } | |
| 1014 | + }); | |
| 1014 | 1015 | }); |
| 1015 | 1016 | ``` |
| 1016 | 1017 | |
| ... | ... | @@ -1092,7 +1093,7 @@ methods: |
| 1092 | 1093 | * `paused` - a boolean for determining whether the queue is in a paused state |
| 1093 | 1094 | * `pause()` - a function that pauses the processing of tasks until `resume()` is called. |
| 1094 | 1095 | * `resume()` - a function that resumes the processing of queued tasks when the queue is paused. |
| 1095 | -* `kill()` - a function that empties remaining tasks from the queue forcing it to go idle. | |
| 1096 | +* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle. | |
| 1096 | 1097 | |
| 1097 | 1098 | __Example__ |
| 1098 | 1099 | |
| ... | ... | @@ -1122,7 +1123,7 @@ q.push({name: 'bar'}, function (err) { |
| 1122 | 1123 | // add some items to the queue (batch-wise) |
| 1123 | 1124 | |
| 1124 | 1125 | q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { |
| 1125 | - console.log('finished processing bar'); | |
| 1126 | + console.log('finished processing item'); | |
| 1126 | 1127 | }); |
| 1127 | 1128 | |
| 1128 | 1129 | // add some items to the front of the queue |
| ... | ... | @@ -1349,7 +1350,7 @@ new tasks much easier (and the code more readable). |
| 1349 | 1350 | |
| 1350 | 1351 | Attempts to get a successful response from `task` no more than `times` times before |
| 1351 | 1352 | returning an error. If the task is successful, the `callback` will be passed the result |
| 1352 | -of the successfull task. If all attemps fail, the callback will be passed the error and | |
| 1353 | +of the successful task. If all attempts fail, the callback will be passed the error and | |
| 1353 | 1354 | result (if any) of the final attempt. |
| 1354 | 1355 | |
| 1355 | 1356 | __Arguments__ |
| ... | ... | @@ -1474,7 +1475,7 @@ three |
| 1474 | 1475 | --------------------------------------- |
| 1475 | 1476 | |
| 1476 | 1477 | <a name="nextTick" /> |
| 1477 | -### nextTick(callback) | |
| 1478 | +### nextTick(callback), setImmediate(callback) | |
| 1478 | 1479 | |
| 1479 | 1480 | Calls `callback` on a later loop around the event loop. In Node.js this just |
| 1480 | 1481 | calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` | ... | ... |
node_modules/async/component.json
| 1 | 1 | { |
| 2 | 2 | "name": "async", |
| 3 | - "repo": "caolan/async", | |
| 4 | 3 | "description": "Higher-order functions and common patterns for asynchronous code", |
| 5 | - "version": "0.1.23", | |
| 6 | - "keywords": [], | |
| 7 | - "dependencies": {}, | |
| 8 | - "development": {}, | |
| 9 | - "main": "lib/async.js", | |
| 10 | - "scripts": [ "lib/async.js" ] | |
| 11 | -} | |
| 4 | + "version": "0.9.2", | |
| 5 | + "keywords": [ | |
| 6 | + "async", | |
| 7 | + "callback", | |
| 8 | + "utility", | |
| 9 | + "module" | |
| 10 | + ], | |
| 11 | + "license": "MIT", | |
| 12 | + "repository": "caolan/async", | |
| 13 | + "scripts": [ | |
| 14 | + "lib/async.js" | |
| 15 | + ] | |
| 16 | +} | |
| 12 | 17 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -42,9 +42,6 @@ |
| 42 | 42 | }; |
| 43 | 43 | |
| 44 | 44 | var _each = function (arr, iterator) { |
| 45 | - if (arr.forEach) { | |
| 46 | - return arr.forEach(iterator); | |
| 47 | - } | |
| 48 | 45 | for (var i = 0; i < arr.length; i += 1) { |
| 49 | 46 | iterator(arr[i], i, arr); |
| 50 | 47 | } |
| ... | ... | @@ -821,23 +818,26 @@ |
| 821 | 818 | pause: function () { |
| 822 | 819 | if (q.paused === true) { return; } |
| 823 | 820 | q.paused = true; |
| 824 | - q.process(); | |
| 825 | 821 | }, |
| 826 | 822 | resume: function () { |
| 827 | 823 | if (q.paused === false) { return; } |
| 828 | 824 | q.paused = false; |
| 829 | - q.process(); | |
| 825 | + // Need to call q.process once per concurrent | |
| 826 | + // worker to preserve full concurrency after pause | |
| 827 | + for (var w = 1; w <= q.concurrency; w++) { | |
| 828 | + async.setImmediate(q.process); | |
| 829 | + } | |
| 830 | 830 | } |
| 831 | 831 | }; |
| 832 | 832 | return q; |
| 833 | 833 | }; |
| 834 | - | |
| 834 | + | |
| 835 | 835 | async.priorityQueue = function (worker, concurrency) { |
| 836 | - | |
| 836 | + | |
| 837 | 837 | function _compareTasks(a, b){ |
| 838 | 838 | return a.priority - b.priority; |
| 839 | 839 | }; |
| 840 | - | |
| 840 | + | |
| 841 | 841 | function _binarySearch(sequence, item, compare) { |
| 842 | 842 | var beg = -1, |
| 843 | 843 | end = sequence.length - 1; |
| ... | ... | @@ -851,7 +851,7 @@ |
| 851 | 851 | } |
| 852 | 852 | return beg; |
| 853 | 853 | } |
| 854 | - | |
| 854 | + | |
| 855 | 855 | function _insert(q, data, priority, callback) { |
| 856 | 856 | if (!q.started){ |
| 857 | 857 | q.started = true; |
| ... | ... | @@ -873,7 +873,7 @@ |
| 873 | 873 | priority: priority, |
| 874 | 874 | callback: typeof callback === 'function' ? callback : null |
| 875 | 875 | }; |
| 876 | - | |
| 876 | + | |
| 877 | 877 | q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); |
| 878 | 878 | |
| 879 | 879 | if (q.saturated && q.tasks.length === q.concurrency) { |
| ... | ... | @@ -882,15 +882,15 @@ |
| 882 | 882 | async.setImmediate(q.process); |
| 883 | 883 | }); |
| 884 | 884 | } |
| 885 | - | |
| 885 | + | |
| 886 | 886 | // Start with a normal queue |
| 887 | 887 | var q = async.queue(worker, concurrency); |
| 888 | - | |
| 888 | + | |
| 889 | 889 | // Override push to accept second parameter representing priority |
| 890 | 890 | q.push = function (data, priority, callback) { |
| 891 | 891 | _insert(q, data, priority, callback); |
| 892 | 892 | }; |
| 893 | - | |
| 893 | + | |
| 894 | 894 | // Remove unshift function |
| 895 | 895 | delete q.unshift; |
| 896 | 896 | ... | ... |
node_modules/async/package.json
| 1 | 1 | { |
| 2 | 2 | "name": "async", |
| 3 | 3 | "description": "Higher-order functions and common patterns for asynchronous code", |
| 4 | - "main": "./lib/async", | |
| 4 | + "main": "lib/async.js", | |
| 5 | 5 | "author": { |
| 6 | 6 | "name": "Caolan McMahon" |
| 7 | 7 | }, |
| 8 | - "version": "0.9.0", | |
| 8 | + "version": "0.9.2", | |
| 9 | + "keywords": [ | |
| 10 | + "async", | |
| 11 | + "callback", | |
| 12 | + "utility", | |
| 13 | + "module" | |
| 14 | + ], | |
| 9 | 15 | "repository": { |
| 10 | 16 | "type": "git", |
| 11 | - "url": "https://github.com/caolan/async.git" | |
| 17 | + "url": "git+https://github.com/caolan/async.git" | |
| 12 | 18 | }, |
| 13 | 19 | "bugs": { |
| 14 | 20 | "url": "https://github.com/caolan/async/issues" |
| 15 | 21 | }, |
| 16 | - "licenses": [ | |
| 17 | - { | |
| 18 | - "type": "MIT", | |
| 19 | - "url": "https://github.com/caolan/async/raw/master/LICENSE" | |
| 20 | - } | |
| 21 | - ], | |
| 22 | + "license": "MIT", | |
| 22 | 23 | "devDependencies": { |
| 23 | 24 | "nodeunit": ">0.0.0", |
| 24 | 25 | "uglify-js": "1.2.x", |
| 25 | - "nodelint": ">0.0.0" | |
| 26 | + "nodelint": ">0.0.0", | |
| 27 | + "lodash": ">=2.4.1" | |
| 26 | 28 | }, |
| 27 | 29 | "jam": { |
| 28 | 30 | "main": "lib/async.js", |
| ... | ... | @@ -30,31 +32,53 @@ |
| 30 | 32 | "lib/async.js", |
| 31 | 33 | "README.md", |
| 32 | 34 | "LICENSE" |
| 35 | + ], | |
| 36 | + "categories": [ | |
| 37 | + "Utilities" | |
| 33 | 38 | ] |
| 34 | 39 | }, |
| 35 | 40 | "scripts": { |
| 36 | 41 | "test": "nodeunit test/test-async.js" |
| 37 | 42 | }, |
| 38 | - "homepage": "https://github.com/caolan/async", | |
| 39 | - "_id": "async@0.9.0", | |
| 40 | - "dist": { | |
| 41 | - "shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7", | |
| 42 | - "tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz" | |
| 43 | + "spm": { | |
| 44 | + "main": "lib/async.js" | |
| 43 | 45 | }, |
| 46 | + "volo": { | |
| 47 | + "main": "lib/async.js", | |
| 48 | + "ignore": [ | |
| 49 | + "**/.*", | |
| 50 | + "node_modules", | |
| 51 | + "bower_components", | |
| 52 | + "test", | |
| 53 | + "tests" | |
| 54 | + ] | |
| 55 | + }, | |
| 56 | + "gitHead": "de3a16091d5125384eff4a54deb3998b13c3814c", | |
| 57 | + "homepage": "https://github.com/caolan/async#readme", | |
| 58 | + "_id": "async@0.9.2", | |
| 59 | + "_shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d", | |
| 44 | 60 | "_from": "async@>=0.9.0 <0.10.0", |
| 45 | - "_npmVersion": "1.4.3", | |
| 61 | + "_npmVersion": "2.9.0", | |
| 62 | + "_nodeVersion": "2.0.1", | |
| 46 | 63 | "_npmUser": { |
| 47 | - "name": "caolan", | |
| 48 | - "email": "caolan.mcmahon@gmail.com" | |
| 64 | + "name": "beaugunderson", | |
| 65 | + "email": "beau@beaugunderson.com" | |
| 49 | 66 | }, |
| 50 | 67 | "maintainers": [ |
| 51 | 68 | { |
| 52 | 69 | "name": "caolan", |
| 53 | - "email": "caolan@caolanmcmahon.com" | |
| 70 | + "email": "caolan.mcmahon@gmail.com" | |
| 71 | + }, | |
| 72 | + { | |
| 73 | + "name": "beaugunderson", | |
| 74 | + "email": "beau@beaugunderson.com" | |
| 54 | 75 | } |
| 55 | 76 | ], |
| 77 | + "dist": { | |
| 78 | + "shasum": "aea74d5e61c1f899613bf64bda66d4c78f2fd17d", | |
| 79 | + "tarball": "http://registry.npmjs.org/async/-/async-0.9.2.tgz" | |
| 80 | + }, | |
| 56 | 81 | "directories": {}, |
| 57 | - "_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7", | |
| 58 | - "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz", | |
| 82 | + "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", | |
| 59 | 83 | "readme": "ERROR: No README data found!" |
| 60 | 84 | } | ... | ... |
node_modules/express/node_modules/commander/node_modules/keypress/package.json
| ... | ... | @@ -36,5 +36,9 @@ |
| 36 | 36 | "directories": {}, |
| 37 | 37 | "_shasum": "4a3188d4291b66b4f65edb99f806aa9ae293592a", |
| 38 | 38 | "_resolved": "https://registry.npmjs.org/keypress/-/keypress-0.1.0.tgz", |
| 39 | - "_from": "keypress@>=0.1.0 <0.2.0" | |
| 39 | + "_from": "keypress@>=0.1.0 <0.2.0", | |
| 40 | + "bugs": { | |
| 41 | + "url": "https://github.com/TooTallNate/keypress/issues" | |
| 42 | + }, | |
| 43 | + "homepage": "https://github.com/TooTallNate/keypress" | |
| 40 | 44 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/bytes/package.json
| ... | ... | @@ -45,5 +45,6 @@ |
| 45 | 45 | ], |
| 46 | 46 | "directories": {}, |
| 47 | 47 | "_shasum": "78e2e0e28c7f9c7b988ea8aee0db4d5fa9941935", |
| 48 | - "_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.3.0.tgz" | |
| 48 | + "_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.3.0.tgz", | |
| 49 | + "readme": "ERROR: No README data found!" | |
| 49 | 50 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/compression/node_modules/bytes/package.json
node_modules/express/node_modules/connect/node_modules/compression/node_modules/negotiator/package.json
| ... | ... | @@ -53,5 +53,10 @@ |
| 53 | 53 | "directories": {}, |
| 54 | 54 | "_shasum": "706d692efeddf574d57ea9fb1ab89a4fa7ee8f60", |
| 55 | 55 | "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.3.0.tgz", |
| 56 | - "_from": "negotiator@0.3.0" | |
| 56 | + "_from": "negotiator@0.3.0", | |
| 57 | + "bugs": { | |
| 58 | + "url": "https://github.com/federomero/negotiator/issues" | |
| 59 | + }, | |
| 60 | + "readme": "ERROR: No README data found!", | |
| 61 | + "homepage": "https://github.com/federomero/negotiator" | |
| 57 | 62 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/cookie-parser/node_modules/cookie/package.json
| ... | ... | @@ -45,5 +45,10 @@ |
| 45 | 45 | ], |
| 46 | 46 | "directories": {}, |
| 47 | 47 | "_shasum": "90eb469ddce905c866de687efc43131d8801f9d0", |
| 48 | - "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz" | |
| 48 | + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz", | |
| 49 | + "bugs": { | |
| 50 | + "url": "https://github.com/shtylman/node-cookie/issues" | |
| 51 | + }, | |
| 52 | + "readme": "ERROR: No README data found!", | |
| 53 | + "homepage": "https://github.com/shtylman/node-cookie" | |
| 49 | 54 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/csurf/node_modules/scmp/package.json
| ... | ... | @@ -50,5 +50,6 @@ |
| 50 | 50 | ], |
| 51 | 51 | "directories": {}, |
| 52 | 52 | "_shasum": "3648df2d7294641e7f78673ffc29681d9bad9073", |
| 53 | - "_resolved": "https://registry.npmjs.org/scmp/-/scmp-0.0.3.tgz" | |
| 53 | + "_resolved": "https://registry.npmjs.org/scmp/-/scmp-0.0.3.tgz", | |
| 54 | + "readme": "ERROR: No README data found!" | |
| 54 | 55 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/express-session/node_modules/cookie/package.json
| ... | ... | @@ -45,5 +45,10 @@ |
| 45 | 45 | ], |
| 46 | 46 | "directories": {}, |
| 47 | 47 | "_shasum": "90eb469ddce905c866de687efc43131d8801f9d0", |
| 48 | - "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz" | |
| 48 | + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz", | |
| 49 | + "bugs": { | |
| 50 | + "url": "https://github.com/shtylman/node-cookie/issues" | |
| 51 | + }, | |
| 52 | + "readme": "ERROR: No README data found!", | |
| 53 | + "homepage": "https://github.com/shtylman/node-cookie" | |
| 49 | 54 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/express-session/node_modules/debug/package.json
| ... | ... | @@ -59,5 +59,6 @@ |
| 59 | 59 | "directories": {}, |
| 60 | 60 | "_shasum": "06e1ea8082c2cb14e39806e22e2f6f757f92af39", |
| 61 | 61 | "_resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", |
| 62 | - "readme": "ERROR: No README data found!" | |
| 62 | + "readme": "ERROR: No README data found!", | |
| 63 | + "scripts": {} | |
| 63 | 64 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/express-session/node_modules/utils-merge/package.json
| ... | ... | @@ -30,7 +30,7 @@ |
| 30 | 30 | "chai": "1.x.x" |
| 31 | 31 | }, |
| 32 | 32 | "scripts": { |
| 33 | - "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" | |
| 33 | + "test": "mocha --reporter spec --require test/bootstrap/node test/*.test.js" | |
| 34 | 34 | }, |
| 35 | 35 | "engines": { |
| 36 | 36 | "node": ">= 0.4.0" |
| ... | ... | @@ -54,5 +54,7 @@ |
| 54 | 54 | ], |
| 55 | 55 | "directories": {}, |
| 56 | 56 | "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8", |
| 57 | - "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz" | |
| 57 | + "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", | |
| 58 | + "readme": "ERROR: No README data found!", | |
| 59 | + "homepage": "https://github.com/jaredhanson/utils-merge" | |
| 58 | 60 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/morgan/node_modules/bytes/package.json
| ... | ... | @@ -37,5 +37,6 @@ |
| 37 | 37 | ], |
| 38 | 38 | "directories": {}, |
| 39 | 39 | "_shasum": "555b08abcb063f8975905302523e4cd4ffdfdf31", |
| 40 | - "_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.1.tgz" | |
| 40 | + "_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.1.tgz", | |
| 41 | + "readme": "ERROR: No README data found!" | |
| 41 | 42 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/multiparty/node_modules/stream-counter/package.json
| ... | ... | @@ -43,5 +43,7 @@ |
| 43 | 43 | ], |
| 44 | 44 | "directories": {}, |
| 45 | 45 | "_shasum": "ded266556319c8b0e222812b9cf3b26fa7d947de", |
| 46 | - "_resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz" | |
| 46 | + "_resolved": "https://registry.npmjs.org/stream-counter/-/stream-counter-0.2.0.tgz", | |
| 47 | + "readme": "ERROR: No README data found!", | |
| 48 | + "homepage": "https://github.com/superjoe30/node-stream-counter" | |
| 47 | 49 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/pause/package.json
| ... | ... | @@ -27,6 +27,5 @@ |
| 27 | 27 | "directories": {}, |
| 28 | 28 | "_shasum": "1d408b3fdb76923b9543d96fb4c9dfd535d9cb5d", |
| 29 | 29 | "_resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", |
| 30 | - "_from": "pause@0.0.1", | |
| 31 | - "readme": "ERROR: No README data found!" | |
| 30 | + "_from": "pause@0.0.1" | |
| 32 | 31 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/qs/package.json
| ... | ... | @@ -49,5 +49,7 @@ |
| 49 | 49 | ], |
| 50 | 50 | "directories": {}, |
| 51 | 51 | "_shasum": "6e015098ff51968b8a3c819001d5f2c89bc4b107", |
| 52 | - "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz" | |
| 52 | + "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz", | |
| 53 | + "readme": "ERROR: No README data found!", | |
| 54 | + "homepage": "https://github.com/visionmedia/node-querystring" | |
| 53 | 55 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/raw-body/package.json
| ... | ... | @@ -53,5 +53,6 @@ |
| 53 | 53 | ], |
| 54 | 54 | "directories": {}, |
| 55 | 55 | "_shasum": "f0b5624388d031f63da07f870c86cb9ccadcb67d", |
| 56 | - "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.4.tgz" | |
| 56 | + "_resolved": "https://registry.npmjs.org/raw-body/-/raw-body-1.1.4.tgz", | |
| 57 | + "readme": "ERROR: No README data found!" | |
| 57 | 58 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/serve-index/node_modules/negotiator/package.json
| ... | ... | @@ -62,5 +62,6 @@ |
| 62 | 62 | ], |
| 63 | 63 | "directories": {}, |
| 64 | 64 | "_shasum": "8c43ea7e4c40ddfe40c3c0234c4ef77500b8fd37", |
| 65 | - "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.2.tgz" | |
| 65 | + "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.2.tgz", | |
| 66 | + "readme": "ERROR: No README data found!" | |
| 66 | 67 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/serve-static/node_modules/parseurl/package.json
| ... | ... | @@ -36,5 +36,6 @@ |
| 36 | 36 | ], |
| 37 | 37 | "directories": {}, |
| 38 | 38 | "_shasum": "2e57dce6efdd37c3518701030944c22bf388b7b4", |
| 39 | - "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.0.1.tgz" | |
| 39 | + "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.0.1.tgz", | |
| 40 | + "readme": "ERROR: No README data found!" | |
| 40 | 41 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/serve-static/package.json
| ... | ... | @@ -66,5 +66,6 @@ |
| 66 | 66 | ], |
| 67 | 67 | "directories": {}, |
| 68 | 68 | "_shasum": "454dfa05bb3ddd4e701a8915b83a278aa91c5643", |
| 69 | - "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.1.0.tgz" | |
| 69 | + "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.1.0.tgz", | |
| 70 | + "readme": "ERROR: No README data found!" | |
| 70 | 71 | } | ... | ... |
node_modules/express/node_modules/connect/node_modules/setimmediate/package.json
| ... | ... | @@ -97,5 +97,7 @@ |
| 97 | 97 | "directories": {}, |
| 98 | 98 | "_shasum": "a9ca56ccbd6a4c3334855f060abcdece5c42ebb7", |
| 99 | 99 | "_resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.1.tgz", |
| 100 | - "_from": "setimmediate@1.0.1" | |
| 100 | + "_from": "setimmediate@1.0.1", | |
| 101 | + "readme": "ERROR: No README data found!", | |
| 102 | + "homepage": "https://github.com/NobleJS/setImmediate" | |
| 101 | 103 | } | ... | ... |
node_modules/express/node_modules/cookie-signature/package.json
| ... | ... | @@ -44,5 +44,6 @@ |
| 44 | 44 | ], |
| 45 | 45 | "directories": {}, |
| 46 | 46 | "_shasum": "91cd997cc51fb641595738c69cda020328f50ff9", |
| 47 | - "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz" | |
| 47 | + "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.3.tgz", | |
| 48 | + "readme": "ERROR: No README data found!" | |
| 48 | 49 | } | ... | ... |
node_modules/express/node_modules/cookie/package.json
| ... | ... | @@ -49,5 +49,6 @@ |
| 49 | 49 | ], |
| 50 | 50 | "directories": {}, |
| 51 | 51 | "_shasum": "72fec3d24e48a3432073d90c12642005061004b1", |
| 52 | - "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz" | |
| 52 | + "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.2.tgz", | |
| 53 | + "readme": "ERROR: No README data found!" | |
| 53 | 54 | } | ... | ... |
node_modules/express/node_modules/debug/package.json
| ... | ... | @@ -56,5 +56,6 @@ |
| 56 | 56 | ], |
| 57 | 57 | "directories": {}, |
| 58 | 58 | "_shasum": "20ff4d26f5e422cb68a1bacbbb61039ad8c1c130", |
| 59 | - "_resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz" | |
| 59 | + "_resolved": "https://registry.npmjs.org/debug/-/debug-0.8.1.tgz", | |
| 60 | + "readme": "ERROR: No README data found!" | |
| 60 | 61 | } | ... | ... |
node_modules/express/node_modules/fresh/package.json
| ... | ... | @@ -46,5 +46,6 @@ |
| 46 | 46 | ], |
| 47 | 47 | "directories": {}, |
| 48 | 48 | "_shasum": "9731dcf5678c7faeb44fb903c4f72df55187fa77", |
| 49 | - "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.2.tgz" | |
| 49 | + "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.2.tgz", | |
| 50 | + "readme": "ERROR: No README data found!" | |
| 50 | 51 | } | ... | ... |
node_modules/express/node_modules/merge-descriptors/package.json
| ... | ... | @@ -38,5 +38,6 @@ |
| 38 | 38 | ], |
| 39 | 39 | "directories": {}, |
| 40 | 40 | "_shasum": "c36a52a781437513c57275f39dd9d317514ac8c7", |
| 41 | - "_resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-0.0.2.tgz" | |
| 41 | + "_resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-0.0.2.tgz", | |
| 42 | + "readme": "ERROR: No README data found!" | |
| 42 | 43 | } | ... | ... |
node_modules/express/node_modules/mkdirp/package.json
| ... | ... | @@ -49,5 +49,6 @@ |
| 49 | 49 | ], |
| 50 | 50 | "directories": {}, |
| 51 | 51 | "_shasum": "291ac2a2d43a19c478662577b5be846fe83b5923", |
| 52 | - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.4.0.tgz" | |
| 52 | + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.4.0.tgz", | |
| 53 | + "readme": "ERROR: No README data found!" | |
| 53 | 54 | } | ... | ... |
node_modules/express/node_modules/range-parser/package.json
| ... | ... | @@ -45,5 +45,7 @@ |
| 45 | 45 | ], |
| 46 | 46 | "directories": {}, |
| 47 | 47 | "_shasum": "a4b264cfe0be5ce36abe3765ac9c2a248746dbc0", |
| 48 | - "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.0.tgz" | |
| 48 | + "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.0.0.tgz", | |
| 49 | + "readme": "ERROR: No README data found!", | |
| 50 | + "homepage": "https://github.com/visionmedia/node-range-parser" | |
| 49 | 51 | } | ... | ... |
node_modules/express/node_modules/send/node_modules/debug/package.json
| ... | ... | @@ -51,5 +51,6 @@ |
| 51 | 51 | ], |
| 52 | 52 | "directories": {}, |
| 53 | 53 | "_shasum": "0541ea91f0e503fdf0c5eed418a32550234967f0", |
| 54 | - "_resolved": "https://registry.npmjs.org/debug/-/debug-0.8.0.tgz" | |
| 54 | + "_resolved": "https://registry.npmjs.org/debug/-/debug-0.8.0.tgz", | |
| 55 | + "readme": "ERROR: No README data found!" | |
| 55 | 56 | } | ... | ... |
node_modules/express/node_modules/send/node_modules/mime/package.json
| ... | ... | @@ -51,5 +51,8 @@ |
| 51 | 51 | ], |
| 52 | 52 | "directories": {}, |
| 53 | 53 | "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", |
| 54 | - "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" | |
| 54 | + "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", | |
| 55 | + "readme": "ERROR: No README data found!", | |
| 56 | + "homepage": "https://github.com/broofa/node-mime", | |
| 57 | + "scripts": {} | |
| 55 | 58 | } | ... | ... |
node_modules/express/node_modules/send/package.json
| ... | ... | @@ -59,5 +59,6 @@ |
| 59 | 59 | ], |
| 60 | 60 | "directories": {}, |
| 61 | 61 | "_shasum": "9718324634806fc75bc4f8f5e51f57d9d66606e7", |
| 62 | - "_resolved": "https://registry.npmjs.org/send/-/send-0.3.0.tgz" | |
| 62 | + "_resolved": "https://registry.npmjs.org/send/-/send-0.3.0.tgz", | |
| 63 | + "readme": "ERROR: No README data found!" | |
| 63 | 64 | } | ... | ... |
node_modules/express/package.json
| ... | ... | @@ -111,5 +111,6 @@ |
| 111 | 111 | ], |
| 112 | 112 | "directories": {}, |
| 113 | 113 | "_shasum": "af440e1ddad078934ec78241420b40bbc56dc2ad", |
| 114 | - "_resolved": "https://registry.npmjs.org/express/-/express-3.5.3.tgz" | |
| 114 | + "_resolved": "https://registry.npmjs.org/express/-/express-3.5.3.tgz", | |
| 115 | + "readme": "ERROR: No README data found!" | |
| 115 | 116 | } | ... | ... |
node_modules/ip/README.md
node_modules/ip/lib/ip.js
| 1 | -var ip = exports, | |
| 2 | - Buffer = require('buffer').Buffer, | |
| 3 | - os = require('os'); | |
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +var ip = exports; | |
| 4 | +var Buffer = require('buffer').Buffer; | |
| 5 | +var os = require('os'); | |
| 4 | 6 | |
| 5 | 7 | ip.toBuffer = function toBuffer(ip, buff, offset) { |
| 6 | 8 | offset = ~~offset; |
| 7 | 9 | |
| 8 | 10 | var result; |
| 9 | 11 | |
| 12 | + if (/^::ffff:(\d{1,3}\.){3,3}\d{1,3}$/.test(ip)) { | |
| 13 | + ip = ip.replace(/^::ffff:/, ''); | |
| 14 | + } | |
| 15 | + | |
| 10 | 16 | if (/^(\d{1,3}\.){3,3}\d{1,3}$/.test(ip)) { |
| 11 | 17 | result = buff || new Buffer(offset + 4); |
| 12 | 18 | ip.split(/\./g).map(function(byte) { |
| 13 | 19 | result[offset++] = parseInt(byte, 10) & 0xff; |
| 14 | 20 | }); |
| 15 | 21 | } else if (/^[a-f0-9:]+$/.test(ip)) { |
| 16 | - var s = ip.split(/::/g, 2), | |
| 17 | - head = (s[0] || '').split(/:/g, 8), | |
| 18 | - tail = (s[1] || '').split(/:/g, 8); | |
| 22 | + var s = ip.split(/::/g, 2); | |
| 23 | + var head = (s[0] || '').split(/:/g, 8); | |
| 24 | + var tail = (s[1] || '').split(/:/g, 8); | |
| 19 | 25 | |
| 20 | 26 | if (tail.length === 0) { |
| 21 | 27 | // xxxx:: |
| ... | ... | @@ -65,6 +71,10 @@ ip.toString = function toString(buff, offset, length) { |
| 65 | 71 | return result; |
| 66 | 72 | }; |
| 67 | 73 | |
| 74 | +function _normalizeFamily(family) { | |
| 75 | + return family ? family.toLowerCase() : 'ipv4'; | |
| 76 | +} | |
| 77 | + | |
| 68 | 78 | ip.fromPrefixLen = function fromPrefixLen(prefixlen, family) { |
| 69 | 79 | if (prefixlen > 32) { |
| 70 | 80 | family = 'ipv6'; |
| ... | ... | @@ -128,14 +138,14 @@ ip.mask = function mask(addr, mask) { |
| 128 | 138 | ip.cidr = function cidr(cidrString) { |
| 129 | 139 | var cidrParts = cidrString.split('/'); |
| 130 | 140 | |
| 131 | - if (cidrParts.length != 2) | |
| 141 | + var addr = cidrParts[0]; | |
| 142 | + if (cidrParts.length !== 2) | |
| 132 | 143 | throw new Error('invalid CIDR subnet: ' + addr); |
| 133 | 144 | |
| 134 | - var addr = cidrParts[0]; | |
| 135 | 145 | var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); |
| 136 | 146 | |
| 137 | 147 | return ip.mask(addr, mask); |
| 138 | -} | |
| 148 | +}; | |
| 139 | 149 | |
| 140 | 150 | ip.subnet = function subnet(addr, mask) { |
| 141 | 151 | var networkAddress = ip.toLong(ip.mask(addr, mask)); |
| ... | ... | @@ -145,7 +155,7 @@ ip.subnet = function subnet(addr, mask) { |
| 145 | 155 | var maskLength = 0; |
| 146 | 156 | |
| 147 | 157 | for (var i = 0; i < maskBuffer.length; i++) { |
| 148 | - if (maskBuffer[i] == 0xff) { | |
| 158 | + if (maskBuffer[i] === 0xff) { | |
| 149 | 159 | maskLength += 8; |
| 150 | 160 | } else { |
| 151 | 161 | var octet = maskBuffer[i] & 0xff; |
| ... | ... | @@ -173,19 +183,19 @@ ip.subnet = function subnet(addr, mask) { |
| 173 | 183 | numberOfAddresses : numberOfAddresses - 2, |
| 174 | 184 | length: numberOfAddresses |
| 175 | 185 | }; |
| 176 | -} | |
| 186 | +}; | |
| 177 | 187 | |
| 178 | 188 | ip.cidrSubnet = function cidrSubnet(cidrString) { |
| 179 | 189 | var cidrParts = cidrString.split('/'); |
| 180 | 190 | |
| 191 | + var addr = cidrParts[0]; | |
| 181 | 192 | if (cidrParts.length !== 2) |
| 182 | 193 | throw new Error('invalid CIDR subnet: ' + addr); |
| 183 | 194 | |
| 184 | - var addr = cidrParts[0]; | |
| 185 | 195 | var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); |
| 186 | 196 | |
| 187 | 197 | return ip.subnet(addr, mask); |
| 188 | -} | |
| 198 | +}; | |
| 189 | 199 | |
| 190 | 200 | ip.not = function not(addr) { |
| 191 | 201 | var buff = ip.toBuffer(addr); |
| ... | ... | @@ -200,7 +210,7 @@ ip.or = function or(a, b) { |
| 200 | 210 | b = ip.toBuffer(b); |
| 201 | 211 | |
| 202 | 212 | // same protocol |
| 203 | - if (a.length == b.length) { | |
| 213 | + if (a.length === b.length) { | |
| 204 | 214 | for (var i = 0; i < a.length; ++i) { |
| 205 | 215 | a[i] |= b[i]; |
| 206 | 216 | } |
| ... | ... | @@ -259,25 +269,26 @@ ip.isEqual = function isEqual(a, b) { |
| 259 | 269 | }; |
| 260 | 270 | |
| 261 | 271 | ip.isPrivate = function isPrivate(addr) { |
| 262 | - return addr.match(/^10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) != null || | |
| 263 | - addr.match(/^192\.168\.([0-9]{1,3})\.([0-9]{1,3})/) != null || | |
| 264 | - addr.match( | |
| 265 | - /^172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})/) != null || | |
| 266 | - addr.match(/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/) != null || | |
| 267 | - addr.match(/^169\.254\.([0-9]{1,3})\.([0-9]{1,3})/) != null || | |
| 268 | - addr.match(/^fc00:/) != null || addr.match(/^fe80:/) != null || | |
| 269 | - addr.match(/^::1$/) != null || addr.match(/^::$/) != null; | |
| 272 | + return /^10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || | |
| 273 | + /^192\.168\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || | |
| 274 | + /^172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || | |
| 275 | + /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || | |
| 276 | + /^169\.254\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || | |
| 277 | + /^fc00:/.test(addr) || | |
| 278 | + /^fe80:/.test(addr) || | |
| 279 | + /^::1$/.test(addr) || | |
| 280 | + /^::$/.test(addr); | |
| 270 | 281 | }; |
| 271 | 282 | |
| 272 | 283 | ip.isPublic = function isPublic(addr) { |
| 273 | 284 | return !ip.isPrivate(addr); |
| 274 | -} | |
| 285 | +}; | |
| 275 | 286 | |
| 276 | 287 | ip.isLoopback = function isLoopback(addr) { |
| 277 | - return /^127\.0\.0\.1$/.test(addr) | |
| 278 | - || /^fe80::1$/.test(addr) | |
| 279 | - || /^::1$/.test(addr) | |
| 280 | - || /^::$/.test(addr); | |
| 288 | + return /^127\.\d+\.\d+\.\d+$/.test(addr) || | |
| 289 | + /^fe80::1$/.test(addr) || | |
| 290 | + /^::1$/.test(addr) || | |
| 291 | + /^::$/.test(addr); | |
| 281 | 292 | }; |
| 282 | 293 | |
| 283 | 294 | ip.loopback = function loopback(family) { |
| ... | ... | @@ -290,9 +301,7 @@ ip.loopback = function loopback(family) { |
| 290 | 301 | throw new Error('family must be ipv4 or ipv6'); |
| 291 | 302 | } |
| 292 | 303 | |
| 293 | - return family === 'ipv4' | |
| 294 | - ? '127.0.0.1' | |
| 295 | - : 'fe80::1'; | |
| 304 | + return family === 'ipv4' ? '127.0.0.1' : 'fe80::1'; | |
| 296 | 305 | }; |
| 297 | 306 | |
| 298 | 307 | // |
| ... | ... | @@ -311,8 +320,8 @@ ip.loopback = function loopback(family) { |
| 311 | 320 | // * undefined: First address with `ipv4` or loopback addres `127.0.0.1`. |
| 312 | 321 | // |
| 313 | 322 | ip.address = function address(name, family) { |
| 314 | - var interfaces = os.networkInterfaces(), | |
| 315 | - all; | |
| 323 | + var interfaces = os.networkInterfaces(); | |
| 324 | + var all; | |
| 316 | 325 | |
| 317 | 326 | // |
| 318 | 327 | // Default to `ipv4` |
| ... | ... | @@ -323,11 +332,14 @@ ip.address = function address(name, family) { |
| 323 | 332 | // If a specific network interface has been named, |
| 324 | 333 | // return the address. |
| 325 | 334 | // |
| 326 | - if (name && !~['public', 'private'].indexOf(name)) { | |
| 327 | - return interfaces[name].filter(function (details) { | |
| 328 | - details.family = details.family.toLowerCase(); | |
| 329 | - return details.family === family; | |
| 330 | - })[0].address; | |
| 335 | + if (name && name !== 'private' && name !== 'public') { | |
| 336 | + var res = interfaces[name].filter(function(details) { | |
| 337 | + var itemFamily = details.family.toLowerCase(); | |
| 338 | + return itemFamily === family; | |
| 339 | + }); | |
| 340 | + if (res.length === 0) | |
| 341 | + return undefined; | |
| 342 | + return res[0].address; | |
| 331 | 343 | } |
| 332 | 344 | |
| 333 | 345 | var all = Object.keys(interfaces).map(function (nic) { |
| ... | ... | @@ -339,42 +351,32 @@ ip.address = function address(name, family) { |
| 339 | 351 | details.family = details.family.toLowerCase(); |
| 340 | 352 | if (details.family !== family || ip.isLoopback(details.address)) { |
| 341 | 353 | return false; |
| 342 | - } | |
| 343 | - else if (!name) { | |
| 354 | + } else if (!name) { | |
| 344 | 355 | return true; |
| 345 | 356 | } |
| 346 | 357 | |
| 347 | - return name === 'public' | |
| 348 | - ? !ip.isPrivate(details.address) | |
| 349 | - : ip.isPrivate(details.address) | |
| 358 | + return name === 'public' ? !ip.isPrivate(details.address) : | |
| 359 | + ip.isPrivate(details.address); | |
| 350 | 360 | }); |
| 351 | 361 | |
| 352 | - return addresses.length | |
| 353 | - ? addresses[0].address | |
| 354 | - : undefined; | |
| 362 | + return addresses.length ? addresses[0].address : undefined; | |
| 355 | 363 | }).filter(Boolean); |
| 356 | 364 | |
| 357 | - return !all.length | |
| 358 | - ? ip.loopback(family) | |
| 359 | - : all[0]; | |
| 365 | + return !all.length ? ip.loopback(family) : all[0]; | |
| 360 | 366 | }; |
| 361 | 367 | |
| 362 | -ip.toLong = function toInt(ip){ | |
| 363 | - var ipl=0; | |
| 364 | - ip.split('.').forEach(function( octet ) { | |
| 365 | - ipl<<=8; | |
| 366 | - ipl+=parseInt(octet); | |
| 368 | +ip.toLong = function toInt(ip) { | |
| 369 | + var ipl = 0; | |
| 370 | + ip.split('.').forEach(function(octet) { | |
| 371 | + ipl <<= 8; | |
| 372 | + ipl += parseInt(octet); | |
| 367 | 373 | }); |
| 368 | - return(ipl >>>0); | |
| 374 | + return(ipl >>> 0); | |
| 369 | 375 | }; |
| 370 | 376 | |
| 371 | -ip.fromLong = function fromInt(ipl){ | |
| 372 | - return ( (ipl>>>24) +'.' + | |
| 373 | - (ipl>>16 & 255) +'.' + | |
| 374 | - (ipl>>8 & 255) +'.' + | |
| 377 | +ip.fromLong = function fromInt(ipl) { | |
| 378 | + return ((ipl >>> 24) + '.' + | |
| 379 | + (ipl >> 16 & 255) + '.' + | |
| 380 | + (ipl >> 8 & 255) + '.' + | |
| 375 | 381 | (ipl & 255) ); |
| 376 | 382 | }; |
| 377 | - | |
| 378 | -function _normalizeFamily(family) { | |
| 379 | - return family ? family.toLowerCase() : 'ipv4'; | |
| 380 | -} | ... | ... |
node_modules/ip/package.json
| 1 | 1 | { |
| 2 | 2 | "name": "ip", |
| 3 | - "version": "0.3.3", | |
| 3 | + "version": "1.0.1", | |
| 4 | 4 | "author": { |
| 5 | 5 | "name": "Fedor Indutny", |
| 6 | 6 | "email": "fedor@indutny.com" |
| ... | ... | @@ -12,22 +12,24 @@ |
| 12 | 12 | }, |
| 13 | 13 | "main": "lib/ip", |
| 14 | 14 | "devDependencies": { |
| 15 | + "jscs": "^2.1.1", | |
| 16 | + "jshint": "^2.8.0", | |
| 15 | 17 | "mocha": "~1.3.2" |
| 16 | 18 | }, |
| 17 | 19 | "scripts": { |
| 18 | - "test": "mocha --reporter spec test/*-test.js" | |
| 20 | + "test": "jscs lib/*.js test/*.js && jshint lib/*.js && mocha --reporter spec test/*-test.js" | |
| 19 | 21 | }, |
| 20 | 22 | "license": "MIT", |
| 21 | - "gitHead": "7798e2d222718087863d8a5a99e3c02f3a30e2b9", | |
| 23 | + "gitHead": "5fa3ae74c70f2af2f3bc1b8784685c5bc004d468", | |
| 22 | 24 | "description": "IP address utilities for node.js", |
| 23 | 25 | "bugs": { |
| 24 | 26 | "url": "https://github.com/indutny/node-ip/issues" |
| 25 | 27 | }, |
| 26 | - "_id": "ip@0.3.3", | |
| 27 | - "_shasum": "8ee8309e92f0b040d287f72efaca1a21702d3fb4", | |
| 28 | + "_id": "ip@1.0.1", | |
| 29 | + "_shasum": "c7e356cdea225ae71b36d70f2e71a92ba4e42590", | |
| 28 | 30 | "_from": "ip@latest", |
| 29 | - "_npmVersion": "2.9.0", | |
| 30 | - "_nodeVersion": "2.0.0", | |
| 31 | + "_npmVersion": "2.14.2", | |
| 32 | + "_nodeVersion": "4.0.0", | |
| 31 | 33 | "_npmUser": { |
| 32 | 34 | "name": "indutny", |
| 33 | 35 | "email": "fedor@indutny.com" |
| ... | ... | @@ -47,9 +49,10 @@ |
| 47 | 49 | } |
| 48 | 50 | ], |
| 49 | 51 | "dist": { |
| 50 | - "shasum": "8ee8309e92f0b040d287f72efaca1a21702d3fb4", | |
| 51 | - "tarball": "http://registry.npmjs.org/ip/-/ip-0.3.3.tgz" | |
| 52 | + "shasum": "c7e356cdea225ae71b36d70f2e71a92ba4e42590", | |
| 53 | + "tarball": "http://registry.npmjs.org/ip/-/ip-1.0.1.tgz" | |
| 52 | 54 | }, |
| 53 | 55 | "directories": {}, |
| 54 | - "_resolved": "https://registry.npmjs.org/ip/-/ip-0.3.3.tgz" | |
| 56 | + "_resolved": "https://registry.npmjs.org/ip/-/ip-1.0.1.tgz", | |
| 57 | + "readme": "ERROR: No README data found!" | |
| 55 | 58 | } | ... | ... |
node_modules/ip/test/api-test.js
| 1 | -var ip = require('..'), | |
| 2 | - assert = require('assert'), | |
| 3 | - net = require('net'), | |
| 4 | - os = require('os'); | |
| 1 | +'use strict'; | |
| 2 | + | |
| 3 | +var ip = require('..'); | |
| 4 | +var assert = require('assert'); | |
| 5 | +var net = require('net'); | |
| 6 | +var os = require('os'); | |
| 5 | 7 | |
| 6 | 8 | describe('IP library for node.js', function() { |
| 7 | 9 | describe('toBuffer()/toString() methods', function() { |
| ... | ... | @@ -38,6 +40,12 @@ describe('IP library for node.js', function() { |
| 38 | 40 | assert.equal(ip.toString(ip.toBuffer('abcd::dcba', buf, offset), |
| 39 | 41 | offset, 16), 'abcd::dcba'); |
| 40 | 42 | }); |
| 43 | + | |
| 44 | + it('should convert to buffer IPv6 mapped IPv4 address', function() { | |
| 45 | + var buf = ip.toBuffer('::ffff:127.0.0.1'); | |
| 46 | + assert.equal(buf.toString('hex'), '7f000001'); | |
| 47 | + assert.equal(ip.toString(buf), '127.0.0.1'); | |
| 48 | + }); | |
| 41 | 49 | }); |
| 42 | 50 | |
| 43 | 51 | describe('fromPrefixLen() method', function() { |
| ... | ... | @@ -198,6 +206,8 @@ describe('IP library for node.js', function() { |
| 198 | 206 | assert(!ip.isEqual('127.0.0.1', '::7f00:2')); |
| 199 | 207 | assert(ip.isEqual('127.0.0.1', '::ffff:7f00:1')); |
| 200 | 208 | assert(!ip.isEqual('127.0.0.1', '::ffaf:7f00:1')); |
| 209 | + assert(ip.isEqual('::ffff:127.0.0.1', '::ffff:127.0.0.1')); | |
| 210 | + assert(ip.isEqual('::ffff:127.0.0.1', '127.0.0.1')); | |
| 201 | 211 | }); |
| 202 | 212 | }); |
| 203 | 213 | |
| ... | ... | @@ -249,69 +259,75 @@ describe('IP library for node.js', function() { |
| 249 | 259 | }); |
| 250 | 260 | }); |
| 251 | 261 | |
| 252 | - describe('loopback() method', function () { | |
| 253 | - describe('undefined', function () { | |
| 254 | - it('should respond with 127.0.0.1', function () { | |
| 262 | + describe('loopback() method', function() { | |
| 263 | + describe('undefined', function() { | |
| 264 | + it('should respond with 127.0.0.1', function() { | |
| 255 | 265 | assert.equal(ip.loopback(), '127.0.0.1') |
| 256 | 266 | }); |
| 257 | 267 | }); |
| 258 | 268 | |
| 259 | - describe('ipv4', function () { | |
| 260 | - it('should respond with 127.0.0.1', function () { | |
| 269 | + describe('ipv4', function() { | |
| 270 | + it('should respond with 127.0.0.1', function() { | |
| 261 | 271 | assert.equal(ip.loopback('ipv4'), '127.0.0.1') |
| 262 | 272 | }); |
| 263 | 273 | }); |
| 264 | 274 | |
| 265 | - describe('ipv6', function () { | |
| 266 | - it('should respond with fe80::1', function () { | |
| 275 | + describe('ipv6', function() { | |
| 276 | + it('should respond with fe80::1', function() { | |
| 267 | 277 | assert.equal(ip.loopback('ipv6'), 'fe80::1') |
| 268 | 278 | }); |
| 269 | 279 | }); |
| 270 | 280 | }); |
| 271 | 281 | |
| 272 | - describe('isLoopback() method', function () { | |
| 273 | - describe('127.0.0.1', function () { | |
| 274 | - it('should respond with true', function () { | |
| 282 | + describe('isLoopback() method', function() { | |
| 283 | + describe('127.0.0.1', function() { | |
| 284 | + it('should respond with true', function() { | |
| 275 | 285 | assert.ok(ip.isLoopback('127.0.0.1')) |
| 276 | 286 | }); |
| 277 | 287 | }); |
| 278 | 288 | |
| 289 | + describe('127.8.8.8', function () { | |
| 290 | + it('should respond with true', function () { | |
| 291 | + assert.ok(ip.isLoopback('127.8.8.8')) | |
| 292 | + }); | |
| 293 | + }); | |
| 294 | + | |
| 279 | 295 | describe('8.8.8.8', function () { |
| 280 | 296 | it('should respond with false', function () { |
| 281 | 297 | assert.equal(ip.isLoopback('8.8.8.8'), false); |
| 282 | 298 | }); |
| 283 | 299 | }); |
| 284 | 300 | |
| 285 | - describe('fe80::1', function () { | |
| 286 | - it('should respond with true', function () { | |
| 301 | + describe('fe80::1', function() { | |
| 302 | + it('should respond with true', function() { | |
| 287 | 303 | assert.ok(ip.isLoopback('fe80::1')) |
| 288 | 304 | }); |
| 289 | 305 | }); |
| 290 | 306 | |
| 291 | - describe('::1', function () { | |
| 292 | - it('should respond with true', function () { | |
| 307 | + describe('::1', function() { | |
| 308 | + it('should respond with true', function() { | |
| 293 | 309 | assert.ok(ip.isLoopback('::1')) |
| 294 | 310 | }); |
| 295 | 311 | }); |
| 296 | 312 | |
| 297 | - describe('::', function () { | |
| 298 | - it('should respond with true', function () { | |
| 313 | + describe('::', function() { | |
| 314 | + it('should respond with true', function() { | |
| 299 | 315 | assert.ok(ip.isLoopback('::')) |
| 300 | 316 | }); |
| 301 | 317 | }); |
| 302 | 318 | }); |
| 303 | 319 | |
| 304 | - describe('address() method', function () { | |
| 305 | - describe('undefined', function () { | |
| 306 | - it('should respond with a private ip', function () { | |
| 320 | + describe('address() method', function() { | |
| 321 | + describe('undefined', function() { | |
| 322 | + it('should respond with a private ip', function() { | |
| 307 | 323 | assert.ok(ip.isPrivate(ip.address())); |
| 308 | 324 | }); |
| 309 | 325 | }); |
| 310 | 326 | |
| 311 | - describe('private', function () { | |
| 312 | - [undefined, 'ipv4', 'ipv6'].forEach(function (family) { | |
| 313 | - describe(family, function () { | |
| 314 | - it('should respond with a private ip', function () { | |
| 327 | + describe('private', function() { | |
| 328 | + [ undefined, 'ipv4', 'ipv6' ].forEach(function(family) { | |
| 329 | + describe(family, function() { | |
| 330 | + it('should respond with a private ip', function() { | |
| 315 | 331 | assert.ok(ip.isPrivate(ip.address('private', family))); |
| 316 | 332 | }); |
| 317 | 333 | }); |
| ... | ... | @@ -320,34 +336,36 @@ describe('IP library for node.js', function() { |
| 320 | 336 | |
| 321 | 337 | var interfaces = os.networkInterfaces(); |
| 322 | 338 | |
| 323 | - Object.keys(interfaces).forEach(function (nic) { | |
| 324 | - describe(nic, function () { | |
| 325 | - [undefined, 'ipv4'].forEach(function (family) { | |
| 326 | - describe(family, function () { | |
| 327 | - it('should respond with an ipv4 address', function () { | |
| 328 | - assert.ok(net.isIPv4(ip.address(nic, family))); | |
| 339 | + Object.keys(interfaces).forEach(function(nic) { | |
| 340 | + describe(nic, function() { | |
| 341 | + [ undefined, 'ipv4' ].forEach(function(family) { | |
| 342 | + describe(family, function() { | |
| 343 | + it('should respond with an ipv4 address', function() { | |
| 344 | + var addr = ip.address(nic, family); | |
| 345 | + assert.ok(!addr || net.isIPv4(addr)); | |
| 329 | 346 | }); |
| 330 | 347 | }); |
| 331 | 348 | }); |
| 332 | 349 | |
| 333 | - describe('ipv6', function () { | |
| 334 | - it('should respond with an ipv6 address', function () { | |
| 335 | - assert.ok(net.isIPv6(ip.address(nic, 'ipv6'))); | |
| 350 | + describe('ipv6', function() { | |
| 351 | + it('should respond with an ipv6 address', function() { | |
| 352 | + var addr = ip.address(nic, 'ipv6'); | |
| 353 | + assert.ok(!addr || net.isIPv6(addr)); | |
| 336 | 354 | }); |
| 337 | 355 | }) |
| 338 | 356 | }); |
| 339 | 357 | }); |
| 340 | 358 | }); |
| 341 | 359 | |
| 342 | - describe('toLong() method', function(){ | |
| 343 | - it('should respond with a int', function(){ | |
| 360 | + describe('toLong() method', function() { | |
| 361 | + it('should respond with a int', function() { | |
| 344 | 362 | assert.equal(ip.toLong('127.0.0.1'), 2130706433); |
| 345 | 363 | assert.equal(ip.toLong('255.255.255.255'), 4294967295); |
| 346 | 364 | }); |
| 347 | 365 | }); |
| 348 | 366 | |
| 349 | - describe('fromLong() method', function(){ | |
| 350 | - it('should repond with ipv4 address', function(){ | |
| 367 | + describe('fromLong() method', function() { | |
| 368 | + it('should repond with ipv4 address', function() { | |
| 351 | 369 | assert.equal(ip.fromLong(2130706433), '127.0.0.1'); |
| 352 | 370 | assert.equal(ip.fromLong(4294967295), '255.255.255.255'); |
| 353 | 371 | }); | ... | ... |
node_modules/mkdirp/.npmignore
node_modules/mkdirp/.travis.yml
node_modules/mkdirp/index.js
| 1 | 1 | var path = require('path'); |
| 2 | 2 | var fs = require('fs'); |
| 3 | +var _0777 = parseInt('0777', 8); | |
| 3 | 4 | |
| 4 | 5 | module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; |
| 5 | 6 | |
| ... | ... | @@ -16,7 +17,7 @@ function mkdirP (p, opts, f, made) { |
| 16 | 17 | var xfs = opts.fs || fs; |
| 17 | 18 | |
| 18 | 19 | if (mode === undefined) { |
| 19 | - mode = 0777 & (~process.umask()); | |
| 20 | + mode = _0777 & (~process.umask()); | |
| 20 | 21 | } |
| 21 | 22 | if (!made) made = null; |
| 22 | 23 | |
| ... | ... | @@ -60,7 +61,7 @@ mkdirP.sync = function sync (p, opts, made) { |
| 60 | 61 | var xfs = opts.fs || fs; |
| 61 | 62 | |
| 62 | 63 | if (mode === undefined) { |
| 63 | - mode = 0777 & (~process.umask()); | |
| 64 | + mode = _0777 & (~process.umask()); | |
| 64 | 65 | } |
| 65 | 66 | if (!made) made = null; |
| 66 | 67 | ... | ... |
node_modules/mkdirp/node_modules/minimist/package.json
| ... | ... | @@ -62,6 +62,5 @@ |
| 62 | 62 | ], |
| 63 | 63 | "directories": {}, |
| 64 | 64 | "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", |
| 65 | - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", | |
| 66 | - "readme": "ERROR: No README data found!" | |
| 65 | + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" | |
| 67 | 66 | } | ... | ... |
node_modules/mkdirp/package.json
| 1 | 1 | { |
| 2 | 2 | "name": "mkdirp", |
| 3 | 3 | "description": "Recursively mkdir, like `mkdir -p`", |
| 4 | - "version": "0.5.0", | |
| 4 | + "version": "0.5.1", | |
| 5 | 5 | "author": { |
| 6 | 6 | "name": "James Halliday", |
| 7 | 7 | "email": "mail@substack.net", |
| 8 | 8 | "url": "http://substack.net" |
| 9 | 9 | }, |
| 10 | - "main": "./index", | |
| 10 | + "main": "index.js", | |
| 11 | 11 | "keywords": [ |
| 12 | 12 | "mkdir", |
| 13 | 13 | "directory" |
| 14 | 14 | ], |
| 15 | 15 | "repository": { |
| 16 | 16 | "type": "git", |
| 17 | - "url": "https://github.com/substack/node-mkdirp.git" | |
| 17 | + "url": "git+https://github.com/substack/node-mkdirp.git" | |
| 18 | 18 | }, |
| 19 | 19 | "scripts": { |
| 20 | 20 | "test": "tap test/*.js" |
| ... | ... | @@ -23,27 +23,30 @@ |
| 23 | 23 | "minimist": "0.0.8" |
| 24 | 24 | }, |
| 25 | 25 | "devDependencies": { |
| 26 | - "tap": "~0.4.0", | |
| 27 | - "mock-fs": "~2.2.0" | |
| 26 | + "tap": "1", | |
| 27 | + "mock-fs": "2 >=2.7.0" | |
| 28 | 28 | }, |
| 29 | 29 | "bin": { |
| 30 | 30 | "mkdirp": "bin/cmd.js" |
| 31 | 31 | }, |
| 32 | 32 | "license": "MIT", |
| 33 | + "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7", | |
| 33 | 34 | "bugs": { |
| 34 | 35 | "url": "https://github.com/substack/node-mkdirp/issues" |
| 35 | 36 | }, |
| 36 | - "homepage": "https://github.com/substack/node-mkdirp", | |
| 37 | - "_id": "mkdirp@0.5.0", | |
| 38 | - "dist": { | |
| 39 | - "shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", | |
| 40 | - "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz" | |
| 41 | - }, | |
| 37 | + "homepage": "https://github.com/substack/node-mkdirp#readme", | |
| 38 | + "_id": "mkdirp@0.5.1", | |
| 39 | + "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", | |
| 42 | 40 | "_from": "mkdirp@>=0.5.0 <0.6.0", |
| 43 | - "_npmVersion": "1.4.3", | |
| 41 | + "_npmVersion": "2.9.0", | |
| 42 | + "_nodeVersion": "2.0.0", | |
| 44 | 43 | "_npmUser": { |
| 45 | 44 | "name": "substack", |
| 46 | - "email": "mail@substack.net" | |
| 45 | + "email": "substack@gmail.com" | |
| 46 | + }, | |
| 47 | + "dist": { | |
| 48 | + "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", | |
| 49 | + "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" | |
| 47 | 50 | }, |
| 48 | 51 | "maintainers": [ |
| 49 | 52 | { |
| ... | ... | @@ -52,7 +55,6 @@ |
| 52 | 55 | } |
| 53 | 56 | ], |
| 54 | 57 | "directories": {}, |
| 55 | - "_shasum": "1d73076a6df986cd9344e15e71fcc05a4c9abf12", | |
| 56 | - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", | |
| 58 | + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", | |
| 57 | 59 | "readme": "ERROR: No README data found!" |
| 58 | 60 | } | ... | ... |
node_modules/mkdirp/test/chmod.js
| ... | ... | @@ -2,6 +2,9 @@ var mkdirp = require('../').mkdirp; |
| 2 | 2 | var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var test = require('tap').test; |
| 5 | +var _0777 = parseInt('0777', 8); | |
| 6 | +var _0755 = parseInt('0755', 8); | |
| 7 | +var _0744 = parseInt('0744', 8); | |
| 5 | 8 | |
| 6 | 9 | var ps = [ '', 'tmp' ]; |
| 7 | 10 | |
| ... | ... | @@ -13,20 +16,20 @@ for (var i = 0; i < 25; i++) { |
| 13 | 16 | var file = ps.join('/'); |
| 14 | 17 | |
| 15 | 18 | test('chmod-pre', function (t) { |
| 16 | - var mode = 0744 | |
| 19 | + var mode = _0744 | |
| 17 | 20 | mkdirp(file, mode, function (er) { |
| 18 | 21 | t.ifError(er, 'should not error'); |
| 19 | 22 | fs.stat(file, function (er, stat) { |
| 20 | 23 | t.ifError(er, 'should exist'); |
| 21 | 24 | t.ok(stat && stat.isDirectory(), 'should be directory'); |
| 22 | - t.equal(stat && stat.mode & 0777, mode, 'should be 0744'); | |
| 25 | + t.equal(stat && stat.mode & _0777, mode, 'should be 0744'); | |
| 23 | 26 | t.end(); |
| 24 | 27 | }); |
| 25 | 28 | }); |
| 26 | 29 | }); |
| 27 | 30 | |
| 28 | 31 | test('chmod', function (t) { |
| 29 | - var mode = 0755 | |
| 32 | + var mode = _0755 | |
| 30 | 33 | mkdirp(file, mode, function (er) { |
| 31 | 34 | t.ifError(er, 'should not error'); |
| 32 | 35 | fs.stat(file, function (er, stat) { | ... | ... |
node_modules/mkdirp/test/clobber.js
| ... | ... | @@ -2,6 +2,7 @@ var mkdirp = require('../').mkdirp; |
| 2 | 2 | var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var test = require('tap').test; |
| 5 | +var _0755 = parseInt('0755', 8); | |
| 5 | 6 | |
| 6 | 7 | var ps = [ '', 'tmp' ]; |
| 7 | 8 | |
| ... | ... | @@ -29,7 +30,7 @@ test('clobber-pre', function (t) { |
| 29 | 30 | |
| 30 | 31 | test('clobber', function (t) { |
| 31 | 32 | t.plan(2); |
| 32 | - mkdirp(file, 0755, function (err) { | |
| 33 | + mkdirp(file, _0755, function (err) { | |
| 33 | 34 | t.ok(err); |
| 34 | 35 | t.equal(err.code, 'ENOTDIR'); |
| 35 | 36 | t.end(); | ... | ... |
node_modules/mkdirp/test/mkdirp.js
| ... | ... | @@ -3,6 +3,8 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('woo', function (t) { |
| 8 | 10 | t.plan(5); |
| ... | ... | @@ -12,13 +14,13 @@ test('woo', function (t) { |
| 12 | 14 | |
| 13 | 15 | var file = '/tmp/' + [x,y,z].join('/'); |
| 14 | 16 | |
| 15 | - mkdirp(file, 0755, function (err) { | |
| 17 | + mkdirp(file, _0755, function (err) { | |
| 16 | 18 | t.ifError(err); |
| 17 | 19 | exists(file, function (ex) { |
| 18 | 20 | t.ok(ex, 'file created'); |
| 19 | 21 | fs.stat(file, function (err, stat) { |
| 20 | 22 | t.ifError(err); |
| 21 | - t.equal(stat.mode & 0777, 0755); | |
| 23 | + t.equal(stat.mode & _0777, _0755); | |
| 22 | 24 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 23 | 25 | }) |
| 24 | 26 | }) | ... | ... |
node_modules/mkdirp/test/opts_fs.js
| ... | ... | @@ -2,6 +2,8 @@ var mkdirp = require('../'); |
| 2 | 2 | var path = require('path'); |
| 3 | 3 | var test = require('tap').test; |
| 4 | 4 | var mockfs = require('mock-fs'); |
| 5 | +var _0777 = parseInt('0777', 8); | |
| 6 | +var _0755 = parseInt('0755', 8); | |
| 5 | 7 | |
| 6 | 8 | test('opts.fs', function (t) { |
| 7 | 9 | t.plan(5); |
| ... | ... | @@ -13,13 +15,13 @@ test('opts.fs', function (t) { |
| 13 | 15 | var file = '/beep/boop/' + [x,y,z].join('/'); |
| 14 | 16 | var xfs = mockfs.fs(); |
| 15 | 17 | |
| 16 | - mkdirp(file, { fs: xfs, mode: 0755 }, function (err) { | |
| 18 | + mkdirp(file, { fs: xfs, mode: _0755 }, function (err) { | |
| 17 | 19 | t.ifError(err); |
| 18 | 20 | xfs.exists(file, function (ex) { |
| 19 | 21 | t.ok(ex, 'created file'); |
| 20 | 22 | xfs.stat(file, function (err, stat) { |
| 21 | 23 | t.ifError(err); |
| 22 | - t.equal(stat.mode & 0777, 0755); | |
| 24 | + t.equal(stat.mode & _0777, _0755); | |
| 23 | 25 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 24 | 26 | }); |
| 25 | 27 | }); | ... | ... |
node_modules/mkdirp/test/opts_fs_sync.js
| ... | ... | @@ -2,6 +2,8 @@ var mkdirp = require('../'); |
| 2 | 2 | var path = require('path'); |
| 3 | 3 | var test = require('tap').test; |
| 4 | 4 | var mockfs = require('mock-fs'); |
| 5 | +var _0777 = parseInt('0777', 8); | |
| 6 | +var _0755 = parseInt('0755', 8); | |
| 5 | 7 | |
| 6 | 8 | test('opts.fs sync', function (t) { |
| 7 | 9 | t.plan(4); |
| ... | ... | @@ -13,12 +15,12 @@ test('opts.fs sync', function (t) { |
| 13 | 15 | var file = '/beep/boop/' + [x,y,z].join('/'); |
| 14 | 16 | var xfs = mockfs.fs(); |
| 15 | 17 | |
| 16 | - mkdirp.sync(file, { fs: xfs, mode: 0755 }); | |
| 18 | + mkdirp.sync(file, { fs: xfs, mode: _0755 }); | |
| 17 | 19 | xfs.exists(file, function (ex) { |
| 18 | 20 | t.ok(ex, 'created file'); |
| 19 | 21 | xfs.stat(file, function (err, stat) { |
| 20 | 22 | t.ifError(err); |
| 21 | - t.equal(stat.mode & 0777, 0755); | |
| 23 | + t.equal(stat.mode & _0777, _0755); | |
| 22 | 24 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 23 | 25 | }); |
| 24 | 26 | }); | ... | ... |
node_modules/mkdirp/test/perm.js
| ... | ... | @@ -3,18 +3,20 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('async perm', function (t) { |
| 8 | 10 | t.plan(5); |
| 9 | 11 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16); |
| 10 | 12 | |
| 11 | - mkdirp(file, 0755, function (err) { | |
| 13 | + mkdirp(file, _0755, function (err) { | |
| 12 | 14 | t.ifError(err); |
| 13 | 15 | exists(file, function (ex) { |
| 14 | 16 | t.ok(ex, 'file created'); |
| 15 | 17 | fs.stat(file, function (err, stat) { |
| 16 | 18 | t.ifError(err); |
| 17 | - t.equal(stat.mode & 0777, 0755); | |
| 19 | + t.equal(stat.mode & _0777, _0755); | |
| 18 | 20 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 19 | 21 | }) |
| 20 | 22 | }) |
| ... | ... | @@ -22,7 +24,7 @@ test('async perm', function (t) { |
| 22 | 24 | }); |
| 23 | 25 | |
| 24 | 26 | test('async root perm', function (t) { |
| 25 | - mkdirp('/tmp', 0755, function (err) { | |
| 27 | + mkdirp('/tmp', _0755, function (err) { | |
| 26 | 28 | if (err) t.fail(err); |
| 27 | 29 | t.end(); |
| 28 | 30 | }); | ... | ... |
node_modules/mkdirp/test/perm_sync.js
| ... | ... | @@ -3,17 +3,19 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('sync perm', function (t) { |
| 8 | 10 | t.plan(4); |
| 9 | 11 | var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json'; |
| 10 | 12 | |
| 11 | - mkdirp.sync(file, 0755); | |
| 13 | + mkdirp.sync(file, _0755); | |
| 12 | 14 | exists(file, function (ex) { |
| 13 | 15 | t.ok(ex, 'file created'); |
| 14 | 16 | fs.stat(file, function (err, stat) { |
| 15 | 17 | t.ifError(err); |
| 16 | - t.equal(stat.mode & 0777, 0755); | |
| 18 | + t.equal(stat.mode & _0777, _0755); | |
| 17 | 19 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 18 | 20 | }); |
| 19 | 21 | }); |
| ... | ... | @@ -23,7 +25,7 @@ test('sync root perm', function (t) { |
| 23 | 25 | t.plan(3); |
| 24 | 26 | |
| 25 | 27 | var file = '/tmp'; |
| 26 | - mkdirp.sync(file, 0755); | |
| 28 | + mkdirp.sync(file, _0755); | |
| 27 | 29 | exists(file, function (ex) { |
| 28 | 30 | t.ok(ex, 'file created'); |
| 29 | 31 | fs.stat(file, function (err, stat) { | ... | ... |
node_modules/mkdirp/test/race.js
| ... | ... | @@ -3,9 +3,11 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('race', function (t) { |
| 8 | - t.plan(6); | |
| 10 | + t.plan(10); | |
| 9 | 11 | var ps = [ '', 'tmp' ]; |
| 10 | 12 | |
| 11 | 13 | for (var i = 0; i < 25; i++) { |
| ... | ... | @@ -15,24 +17,19 @@ test('race', function (t) { |
| 15 | 17 | var file = ps.join('/'); |
| 16 | 18 | |
| 17 | 19 | var res = 2; |
| 18 | - mk(file, function () { | |
| 19 | - if (--res === 0) t.end(); | |
| 20 | - }); | |
| 20 | + mk(file); | |
| 21 | 21 | |
| 22 | - mk(file, function () { | |
| 23 | - if (--res === 0) t.end(); | |
| 24 | - }); | |
| 22 | + mk(file); | |
| 25 | 23 | |
| 26 | 24 | function mk (file, cb) { |
| 27 | - mkdirp(file, 0755, function (err) { | |
| 25 | + mkdirp(file, _0755, function (err) { | |
| 28 | 26 | t.ifError(err); |
| 29 | 27 | exists(file, function (ex) { |
| 30 | 28 | t.ok(ex, 'file created'); |
| 31 | 29 | fs.stat(file, function (err, stat) { |
| 32 | 30 | t.ifError(err); |
| 33 | - t.equal(stat.mode & 0777, 0755); | |
| 31 | + t.equal(stat.mode & _0777, _0755); | |
| 34 | 32 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 35 | - if (cb) cb(); | |
| 36 | 33 | }); |
| 37 | 34 | }) |
| 38 | 35 | }); | ... | ... |
node_modules/mkdirp/test/rel.js
| ... | ... | @@ -3,6 +3,8 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('rel', function (t) { |
| 8 | 10 | t.plan(5); |
| ... | ... | @@ -15,14 +17,14 @@ test('rel', function (t) { |
| 15 | 17 | |
| 16 | 18 | var file = [x,y,z].join('/'); |
| 17 | 19 | |
| 18 | - mkdirp(file, 0755, function (err) { | |
| 20 | + mkdirp(file, _0755, function (err) { | |
| 19 | 21 | t.ifError(err); |
| 20 | 22 | exists(file, function (ex) { |
| 21 | 23 | t.ok(ex, 'file created'); |
| 22 | 24 | fs.stat(file, function (err, stat) { |
| 23 | 25 | t.ifError(err); |
| 24 | 26 | process.chdir(cwd); |
| 25 | - t.equal(stat.mode & 0777, 0755); | |
| 27 | + t.equal(stat.mode & _0777, _0755); | |
| 26 | 28 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 27 | 29 | }) |
| 28 | 30 | }) | ... | ... |
node_modules/mkdirp/test/root.js
| ... | ... | @@ -2,12 +2,13 @@ var mkdirp = require('../'); |
| 2 | 2 | var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var test = require('tap').test; |
| 5 | +var _0755 = parseInt('0755', 8); | |
| 5 | 6 | |
| 6 | 7 | test('root', function (t) { |
| 7 | 8 | // '/' on unix, 'c:/' on windows. |
| 8 | 9 | var file = path.resolve('/'); |
| 9 | 10 | |
| 10 | - mkdirp(file, 0755, function (err) { | |
| 11 | + mkdirp(file, _0755, function (err) { | |
| 11 | 12 | if (err) throw err |
| 12 | 13 | fs.stat(file, function (er, stat) { |
| 13 | 14 | if (er) throw er | ... | ... |
node_modules/mkdirp/test/sync.js
| ... | ... | @@ -3,6 +3,8 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('sync', function (t) { |
| 8 | 10 | t.plan(4); |
| ... | ... | @@ -13,7 +15,7 @@ test('sync', function (t) { |
| 13 | 15 | var file = '/tmp/' + [x,y,z].join('/'); |
| 14 | 16 | |
| 15 | 17 | try { |
| 16 | - mkdirp.sync(file, 0755); | |
| 18 | + mkdirp.sync(file, _0755); | |
| 17 | 19 | } catch (err) { |
| 18 | 20 | t.fail(err); |
| 19 | 21 | return t.end(); |
| ... | ... | @@ -23,7 +25,7 @@ test('sync', function (t) { |
| 23 | 25 | t.ok(ex, 'file created'); |
| 24 | 26 | fs.stat(file, function (err, stat) { |
| 25 | 27 | t.ifError(err); |
| 26 | - t.equal(stat.mode & 0777, 0755); | |
| 28 | + t.equal(stat.mode & _0777, _0755); | |
| 27 | 29 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 28 | 30 | }); |
| 29 | 31 | }); | ... | ... |
node_modules/mkdirp/test/umask.js
| ... | ... | @@ -3,6 +3,8 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('implicit mode from umask', function (t) { |
| 8 | 10 | t.plan(5); |
| ... | ... | @@ -18,7 +20,7 @@ test('implicit mode from umask', function (t) { |
| 18 | 20 | t.ok(ex, 'file created'); |
| 19 | 21 | fs.stat(file, function (err, stat) { |
| 20 | 22 | t.ifError(err); |
| 21 | - t.equal(stat.mode & 0777, 0777 & (~process.umask())); | |
| 23 | + t.equal(stat.mode & _0777, _0777 & (~process.umask())); | |
| 22 | 24 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 23 | 25 | }); |
| 24 | 26 | }) | ... | ... |
node_modules/mkdirp/test/umask_sync.js
| ... | ... | @@ -3,6 +3,8 @@ var path = require('path'); |
| 3 | 3 | var fs = require('fs'); |
| 4 | 4 | var exists = fs.exists || path.exists; |
| 5 | 5 | var test = require('tap').test; |
| 6 | +var _0777 = parseInt('0777', 8); | |
| 7 | +var _0755 = parseInt('0755', 8); | |
| 6 | 8 | |
| 7 | 9 | test('umask sync modes', function (t) { |
| 8 | 10 | t.plan(4); |
| ... | ... | @@ -23,7 +25,7 @@ test('umask sync modes', function (t) { |
| 23 | 25 | t.ok(ex, 'file created'); |
| 24 | 26 | fs.stat(file, function (err, stat) { |
| 25 | 27 | t.ifError(err); |
| 26 | - t.equal(stat.mode & 0777, (0777 & (~process.umask()))); | |
| 28 | + t.equal(stat.mode & _0777, (_0777 & (~process.umask()))); | |
| 27 | 29 | t.ok(stat.isDirectory(), 'target not a directory'); |
| 28 | 30 | }); |
| 29 | 31 | }); | ... | ... |
server.js
| ... | ... | @@ -21,6 +21,7 @@ var logger = require('./logsystem/main.js'); |
| 21 | 21 | var kue = require('kue'); |
| 22 | 22 | var queue = kue.createQueue(); |
| 23 | 23 | var unirest = require('unirest'); |
| 24 | +var ui = require('kue-ui'); | |
| 24 | 25 | |
| 25 | 26 | var PythonShell = require('python-shell'); |
| 26 | 27 | |
| ... | ... | @@ -30,6 +31,9 @@ var options = { |
| 30 | 31 | args: [] |
| 31 | 32 | }; |
| 32 | 33 | |
| 34 | +app.use('/kue', kue.app); | |
| 35 | +// app.use('/kueui', ui.app); | |
| 36 | + | |
| 33 | 37 | app.use(express.static(path.join(__dirname, '/videos'))); |
| 34 | 38 | app.use(express.bodyParser({ keepExtensions: true, uploadDir: path.join(__dirname, '/uploads') })); |
| 35 | 39 | |
| ... | ... | @@ -216,18 +220,18 @@ app.listen(properties.port, properties.host, function(){ |
| 216 | 220 | |
| 217 | 221 | |
| 218 | 222 | |
| 219 | -var CronJob = require('cron').CronJob; | |
| 220 | -// '* * * * * *' == a cada 1 segundo | |
| 221 | -new CronJob('* * * * * *', function() { | |
| 222 | - unirest.post('http://localhost:5000/api') | |
| 223 | - .header('Accept', 'application/json') | |
| 224 | - .send({ "servico": "texto", "transparencia": "opaco", "texto": "texto teste" }) | |
| 225 | - .end(function (response) { | |
| 226 | - console.log(response.status); | |
| 227 | - if(response.status === 200){ | |
| 228 | - logger.updateHealth("outros", 1); | |
| 229 | - } else { | |
| 230 | - logger.updateHealth(); | |
| 231 | - } | |
| 232 | - }); | |
| 233 | -}, null, true); // no lugar do null pode ser uma funcao pra executar quando parar | |
| 223 | +// var CronJob = require('cron').CronJob; | |
| 224 | +// // '* * * * * *' == a cada 1 segundo | |
| 225 | +// new CronJob('* 2 * * * *', function() { | |
| 226 | +// unirest.post('http://localhost:5000/api') | |
| 227 | +// .header('Accept', 'application/json') | |
| 228 | +// .send({ "servico": "texto", "transparencia": "opaco", "texto": "texto teste" }) | |
| 229 | +// .end(function (response) { | |
| 230 | +// console.log(response.status); | |
| 231 | +// if(response.status === 200){ | |
| 232 | +// logger.updateHealth("outros", 1); | |
| 233 | +// } else { | |
| 234 | +// logger.updateHealth(); | |
| 235 | +// } | |
| 236 | +// }); | |
| 237 | +// }, null, true); // no lugar do null pode ser uma funcao pra executar quando parar | ... | ... |