all da files
This commit is contained in:
		
							
								
								
									
										1
									
								
								node_modules/jsonp/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								node_modules/jsonp/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
node_modules
 | 
			
		||||
							
								
								
									
										17
									
								
								node_modules/jsonp/History.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								node_modules/jsonp/History.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
 | 
			
		||||
0.0.3 / 2013-02-03
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * use `index.js`
 | 
			
		||||
  * go back to integer ids
 | 
			
		||||
  * honor `param` option
 | 
			
		||||
 | 
			
		||||
0.0.2 / 2013-02-03
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * make IE<=8 happy
 | 
			
		||||
 | 
			
		||||
0.0.1 / 2012-07-03
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Initial release.
 | 
			
		||||
							
								
								
									
										25
									
								
								node_modules/jsonp/Readme.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								node_modules/jsonp/Readme.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
 | 
			
		||||
# jsonp
 | 
			
		||||
 | 
			
		||||
A simple JSONP implementation.
 | 
			
		||||
 | 
			
		||||
## API
 | 
			
		||||
 | 
			
		||||
### jsonp(url, opts, fn)
 | 
			
		||||
 | 
			
		||||
- `url` (`String`) url to fetch
 | 
			
		||||
- `opts` (`Object`), optional
 | 
			
		||||
  - `param` (`String`) name of the query string component to specify
 | 
			
		||||
    the callback (defaults to `callback`)
 | 
			
		||||
  - `timeout` (`Number`) how long after a timeout error is emitted. `0` to
 | 
			
		||||
    disable (defaults to `60000`)
 | 
			
		||||
- `fn` callback
 | 
			
		||||
 | 
			
		||||
The callback is called with `err, data` parameters. 
 | 
			
		||||
 | 
			
		||||
If it times out, the `err` will be an `Error` object whose `message` is
 | 
			
		||||
`Timeout`.
 | 
			
		||||
 | 
			
		||||
## License
 | 
			
		||||
 | 
			
		||||
MIT
 | 
			
		||||
							
								
								
									
										11
									
								
								node_modules/jsonp/component.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								node_modules/jsonp/component.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "jsonp",
 | 
			
		||||
  "repo": "learnboost/jsonp",
 | 
			
		||||
  "description": "A sane JSONP implementation.",
 | 
			
		||||
  "version": "0.0.3",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "visionmedia/debug": "*"
 | 
			
		||||
  },
 | 
			
		||||
  "scripts": ["index.js"],
 | 
			
		||||
  "main": "index.js"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										84
									
								
								node_modules/jsonp/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								node_modules/jsonp/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,84 @@
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module dependencies
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var debug = require('debug')('jsonp');
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Module exports.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
module.exports = jsonp;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Callback index.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var count = 0;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Noop function.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function noop(){};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * JSONP handler
 | 
			
		||||
 *
 | 
			
		||||
 * Options:
 | 
			
		||||
 *  - param {String} qs parameter (`callback`)
 | 
			
		||||
 *  - timeout {Number} how long after a timeout error is emitted (`60000`)
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} url
 | 
			
		||||
 * @param {Object|Function} optional options / callback
 | 
			
		||||
 * @param {Function} optional callback
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function jsonp(url, opts, fn){
 | 
			
		||||
  if ('function' == typeof opts) {
 | 
			
		||||
    fn = opts;
 | 
			
		||||
    opts = {};
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  var opts = opts || {};
 | 
			
		||||
  var param = opts.param || 'callback';
 | 
			
		||||
  var timeout = null != opts.timeout ? opts.timeout : 60000;
 | 
			
		||||
  var enc = encodeURIComponent;
 | 
			
		||||
  var target = document.getElementsByTagName('script')[0];
 | 
			
		||||
  var script;
 | 
			
		||||
  var timer;
 | 
			
		||||
 | 
			
		||||
  // generate a unique id for this request
 | 
			
		||||
  var id = count++;
 | 
			
		||||
 | 
			
		||||
  if (timeout) {
 | 
			
		||||
    timer = setTimeout(function(){
 | 
			
		||||
      cleanup();
 | 
			
		||||
      fn && fn(new Error('Timeout'));
 | 
			
		||||
    }, timeout);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function cleanup(){
 | 
			
		||||
    target.parentNode.removeChild(script);
 | 
			
		||||
    window['__jp' + id] = noop;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  window['__jp' + id] = function(data){
 | 
			
		||||
    debug('jsonp got', data);
 | 
			
		||||
    if (timer) clearTimeout(timer);
 | 
			
		||||
    cleanup();
 | 
			
		||||
    fn && fn(null, data);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  // add qs component
 | 
			
		||||
  url += (~url.indexOf('?') ? '&' : '?') + param + '=' + enc('__jp' + id + '');
 | 
			
		||||
  url = url.replace('?&', '?');
 | 
			
		||||
 | 
			
		||||
  debug('jsonp req "%s"', url);
 | 
			
		||||
 | 
			
		||||
  // create script
 | 
			
		||||
  script = document.createElement('script');
 | 
			
		||||
  script.src = url;
 | 
			
		||||
  target.parentNode.insertBefore(script, target);
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										4
									
								
								node_modules/jsonp/node_modules/debug/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								node_modules/jsonp/node_modules/debug/.npmignore
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
support
 | 
			
		||||
test
 | 
			
		||||
examples
 | 
			
		||||
*.sock
 | 
			
		||||
							
								
								
									
										62
									
								
								node_modules/jsonp/node_modules/debug/History.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								node_modules/jsonp/node_modules/debug/History.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
			
		||||
 | 
			
		||||
0.7.2 / 2013-02-06 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * fix package.json
 | 
			
		||||
  * fix: Mobile Safari (private mode) is broken with debug
 | 
			
		||||
  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
 | 
			
		||||
 | 
			
		||||
0.7.1 / 2013-02-05 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * add repository URL to package.json
 | 
			
		||||
  * add DEBUG_COLORED to force colored output
 | 
			
		||||
  * add browserify support
 | 
			
		||||
  * fix component. Closes #24
 | 
			
		||||
 | 
			
		||||
0.7.0 / 2012-05-04 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added .component to package.json
 | 
			
		||||
  * Added debug.component.js build
 | 
			
		||||
 | 
			
		||||
0.6.0 / 2012-03-16 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added support for "-" prefix in DEBUG [Vinay Pulim]
 | 
			
		||||
  * Added `.enabled` flag to the node version [TooTallNate] 
 | 
			
		||||
 | 
			
		||||
0.5.0 / 2012-02-02 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added: humanize diffs. Closes #8
 | 
			
		||||
  * Added `debug.disable()` to the CS variant
 | 
			
		||||
  * Removed padding. Closes #10
 | 
			
		||||
  * Fixed: persist client-side variant again. Closes #9
 | 
			
		||||
 | 
			
		||||
0.4.0 / 2012-02-01 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added browser variant support for older browsers [TooTallNate]
 | 
			
		||||
  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
 | 
			
		||||
  * Added padding to diff (moved it to the right)
 | 
			
		||||
 | 
			
		||||
0.3.0 / 2012-01-26 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added millisecond diff when isatty, otherwise UTC string
 | 
			
		||||
 | 
			
		||||
0.2.0 / 2012-01-22 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added wildcard support
 | 
			
		||||
 | 
			
		||||
0.1.0 / 2011-12-02 
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Added: remove colors unless stderr isatty [TooTallNate]
 | 
			
		||||
 | 
			
		||||
0.0.1 / 2010-01-03
 | 
			
		||||
==================
 | 
			
		||||
 | 
			
		||||
  * Initial release
 | 
			
		||||
							
								
								
									
										115
									
								
								node_modules/jsonp/node_modules/debug/Readme.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										115
									
								
								node_modules/jsonp/node_modules/debug/Readme.md
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,115 @@
 | 
			
		||||
 | 
			
		||||
# debug
 | 
			
		||||
 | 
			
		||||
  tiny node.js debugging utility modelled after node core's debugging technique.
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
$ npm install debug
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
 With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.
 | 
			
		||||
 
 | 
			
		||||
Example _app.js_:
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
var debug = require('debug')('http')
 | 
			
		||||
  , http = require('http')
 | 
			
		||||
  , name = 'My App';
 | 
			
		||||
 | 
			
		||||
// fake app
 | 
			
		||||
 | 
			
		||||
debug('booting %s', name);
 | 
			
		||||
 | 
			
		||||
http.createServer(function(req, res){
 | 
			
		||||
  debug(req.method + ' ' + req.url);
 | 
			
		||||
  res.end('hello\n');
 | 
			
		||||
}).listen(3000, function(){
 | 
			
		||||
  debug('listening');
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// fake worker of some kind
 | 
			
		||||
 | 
			
		||||
require('./worker');
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Example _worker.js_:
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
var debug = require('debug')('worker');
 | 
			
		||||
 | 
			
		||||
setInterval(function(){
 | 
			
		||||
  debug('doing some work');
 | 
			
		||||
}, 1000);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
## Millisecond diff
 | 
			
		||||
 | 
			
		||||
  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
 | 
			
		||||
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
 | 
			
		||||
  
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
## Conventions
 | 
			
		||||
 | 
			
		||||
 If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". 
 | 
			
		||||
 | 
			
		||||
## Wildcards
 | 
			
		||||
 | 
			
		||||
  The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
 | 
			
		||||
 | 
			
		||||
  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=* -connect:*` would include all debuggers except those starting with "connect:".
 | 
			
		||||
 | 
			
		||||
## Browser support
 | 
			
		||||
 | 
			
		||||
 Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. 
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
a = debug('worker:a');
 | 
			
		||||
b = debug('worker:b');
 | 
			
		||||
 | 
			
		||||
setInterval(function(){
 | 
			
		||||
  a('doing some work');
 | 
			
		||||
}, 1000);
 | 
			
		||||
 | 
			
		||||
setInterval(function(){
 | 
			
		||||
  a('doing some work');
 | 
			
		||||
}, 1200);
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## 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.
 | 
			
		||||
							
								
								
									
										9
									
								
								node_modules/jsonp/node_modules/debug/component.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								node_modules/jsonp/node_modules/debug/component.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,9 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "debug",
 | 
			
		||||
  "repo": "visionmedia/debug",
 | 
			
		||||
  "description": "small debugging utility",
 | 
			
		||||
  "version": "0.7.2",
 | 
			
		||||
  "keywords": ["debug", "log", "debugger"],
 | 
			
		||||
  "scripts": ["index.js", "debug.js"],
 | 
			
		||||
  "dependencies": {}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										124
									
								
								node_modules/jsonp/node_modules/debug/debug.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										124
									
								
								node_modules/jsonp/node_modules/debug/debug.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,124 @@
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Expose `debug()` as the module.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
module.exports = debug;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Create a debugger with the given `name`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} name
 | 
			
		||||
 * @return {Type}
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function debug(name) {
 | 
			
		||||
  if (!debug.enabled(name)) return function(){};
 | 
			
		||||
 | 
			
		||||
  return function(fmt){
 | 
			
		||||
    var curr = new Date;
 | 
			
		||||
    var ms = curr - (debug[name] || curr);
 | 
			
		||||
    debug[name] = curr;
 | 
			
		||||
 | 
			
		||||
    fmt = name
 | 
			
		||||
      + ' '
 | 
			
		||||
      + fmt
 | 
			
		||||
      + ' +' + debug.humanize(ms);
 | 
			
		||||
 | 
			
		||||
    // This hackery is required for IE8
 | 
			
		||||
    // where `console.log` doesn't have 'apply'
 | 
			
		||||
    window.console
 | 
			
		||||
      && console.log
 | 
			
		||||
      && Function.prototype.apply.call(console.log, console, arguments);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * The currently active debug mode names.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
debug.names = [];
 | 
			
		||||
debug.skips = [];
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Enables a debug mode by name. This can include modes
 | 
			
		||||
 * separated by a colon and wildcards.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} name
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
debug.enable = function(name) {
 | 
			
		||||
  try {
 | 
			
		||||
    localStorage.debug = name;
 | 
			
		||||
  } catch(e){}
 | 
			
		||||
 | 
			
		||||
  var split = (name || '').split(/[\s,]+/)
 | 
			
		||||
    , len = split.length;
 | 
			
		||||
 | 
			
		||||
  for (var i = 0; i < len; i++) {
 | 
			
		||||
    name = split[i].replace('*', '.*?');
 | 
			
		||||
    if (name[0] === '-') {
 | 
			
		||||
      debug.skips.push(new RegExp('^' + name.substr(1) + '$'));
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
      debug.names.push(new RegExp('^' + name + '$'));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Disable debug output.
 | 
			
		||||
 *
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
debug.disable = function(){
 | 
			
		||||
  debug.enable('');
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Humanize the given `ms`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {Number} m
 | 
			
		||||
 * @return {String}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
debug.humanize = function(ms) {
 | 
			
		||||
  var sec = 1000
 | 
			
		||||
    , min = 60 * 1000
 | 
			
		||||
    , hour = 60 * min;
 | 
			
		||||
 | 
			
		||||
  if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
 | 
			
		||||
  if (ms >= min) return (ms / min).toFixed(1) + 'm';
 | 
			
		||||
  if (ms >= sec) return (ms / sec | 0) + 's';
 | 
			
		||||
  return ms + 'ms';
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Returns true if the given mode name is enabled, false otherwise.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} name
 | 
			
		||||
 * @return {Boolean}
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
debug.enabled = function(name) {
 | 
			
		||||
  for (var i = 0, len = debug.skips.length; i < len; i++) {
 | 
			
		||||
    if (debug.skips[i].test(name)) {
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  for (var i = 0, len = debug.names.length; i < len; i++) {
 | 
			
		||||
    if (debug.names[i].test(name)) {
 | 
			
		||||
      return true;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  return false;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// persist
 | 
			
		||||
 | 
			
		||||
if (window.localStorage) debug.enable(localStorage.debug);
 | 
			
		||||
							
								
								
									
										19
									
								
								node_modules/jsonp/node_modules/debug/example/app.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								node_modules/jsonp/node_modules/debug/example/app.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
 | 
			
		||||
var debug = require('../')('http')
 | 
			
		||||
  , http = require('http')
 | 
			
		||||
  , name = 'My App';
 | 
			
		||||
 | 
			
		||||
// fake app
 | 
			
		||||
 | 
			
		||||
debug('booting %s', name);
 | 
			
		||||
 | 
			
		||||
http.createServer(function(req, res){
 | 
			
		||||
  debug(req.method + ' ' + req.url);
 | 
			
		||||
  res.end('hello\n');
 | 
			
		||||
}).listen(3000, function(){
 | 
			
		||||
  debug('listening');
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// fake worker of some kind
 | 
			
		||||
 | 
			
		||||
require('./worker');
 | 
			
		||||
							
								
								
									
										24
									
								
								node_modules/jsonp/node_modules/debug/example/browser.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								node_modules/jsonp/node_modules/debug/example/browser.html
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
<html>
 | 
			
		||||
  <head>
 | 
			
		||||
    <title>debug()</title>
 | 
			
		||||
    <script src="../debug.js"></script>
 | 
			
		||||
    <script>
 | 
			
		||||
      // type debug.enable('*') in
 | 
			
		||||
      // the console and refresh :)
 | 
			
		||||
 | 
			
		||||
      a = debug('worker:a');
 | 
			
		||||
      b = debug('worker:b');
 | 
			
		||||
 | 
			
		||||
      setInterval(function(){
 | 
			
		||||
        a('doing some work');
 | 
			
		||||
      }, 1000);
 | 
			
		||||
 | 
			
		||||
      setInterval(function(){
 | 
			
		||||
        a('doing some work');
 | 
			
		||||
      }, 1200);
 | 
			
		||||
    </script>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    
 | 
			
		||||
  </body>
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										10
									
								
								node_modules/jsonp/node_modules/debug/example/wildcards.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								node_modules/jsonp/node_modules/debug/example/wildcards.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
 | 
			
		||||
var debug = {
 | 
			
		||||
  foo: require('../')('test:foo'),
 | 
			
		||||
  bar: require('../')('test:bar'),
 | 
			
		||||
  baz: require('../')('test:baz')
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
debug.foo('foo')
 | 
			
		||||
debug.bar('bar')
 | 
			
		||||
debug.baz('baz')
 | 
			
		||||
							
								
								
									
										22
									
								
								node_modules/jsonp/node_modules/debug/example/worker.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								node_modules/jsonp/node_modules/debug/example/worker.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,22 @@
 | 
			
		||||
 | 
			
		||||
// DEBUG=* node example/worker
 | 
			
		||||
// DEBUG=worker:* node example/worker
 | 
			
		||||
// DEBUG=worker:a node example/worker
 | 
			
		||||
// DEBUG=worker:b node example/worker
 | 
			
		||||
 | 
			
		||||
var a = require('../')('worker:a')
 | 
			
		||||
  , b = require('../')('worker:b');
 | 
			
		||||
 | 
			
		||||
function work() {
 | 
			
		||||
  a('doing lots of uninteresting work');
 | 
			
		||||
  setTimeout(work, Math.random() * 1000);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
work();
 | 
			
		||||
 | 
			
		||||
function workb() {
 | 
			
		||||
  b('doing some work');
 | 
			
		||||
  setTimeout(workb, Math.random() * 2000);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
workb();
 | 
			
		||||
							
								
								
									
										5
									
								
								node_modules/jsonp/node_modules/debug/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								node_modules/jsonp/node_modules/debug/index.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
if ('undefined' == typeof window) {
 | 
			
		||||
  module.exports = require('./lib/debug');
 | 
			
		||||
} else {
 | 
			
		||||
  module.exports = require('./debug');
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										134
									
								
								node_modules/jsonp/node_modules/debug/lib/debug.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										134
									
								
								node_modules/jsonp/node_modules/debug/lib/debug.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,134 @@
 | 
			
		||||
/**
 | 
			
		||||
 * Module dependencies.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var tty = require('tty');
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Expose `debug()` as the module.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
module.exports = debug;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Enabled debuggers.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var names = []
 | 
			
		||||
  , skips = [];
 | 
			
		||||
 | 
			
		||||
(process.env.DEBUG || '')
 | 
			
		||||
  .split(/[\s,]+/)
 | 
			
		||||
  .forEach(function(name){
 | 
			
		||||
    name = name.replace('*', '.*?');
 | 
			
		||||
    if (name[0] === '-') {
 | 
			
		||||
      skips.push(new RegExp('^' + name.substr(1) + '$'));
 | 
			
		||||
    } else {
 | 
			
		||||
      names.push(new RegExp('^' + name + '$'));
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Colors.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var colors = [6, 2, 3, 4, 5, 1];
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Previous debug() call.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var prev = {};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Previously assigned color.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var prevColor = 0;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Is stdout a TTY? Colored output is disabled when `true`.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
var isatty = tty.isatty(2);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Select a color.
 | 
			
		||||
 *
 | 
			
		||||
 * @return {Number}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function color() {
 | 
			
		||||
  return colors[prevColor++ % colors.length];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Humanize the given `ms`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {Number} m
 | 
			
		||||
 * @return {String}
 | 
			
		||||
 * @api private
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function humanize(ms) {
 | 
			
		||||
  var sec = 1000
 | 
			
		||||
    , min = 60 * 1000
 | 
			
		||||
    , hour = 60 * min;
 | 
			
		||||
 | 
			
		||||
  if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
 | 
			
		||||
  if (ms >= min) return (ms / min).toFixed(1) + 'm';
 | 
			
		||||
  if (ms >= sec) return (ms / sec | 0) + 's';
 | 
			
		||||
  return ms + 'ms';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Create a debugger with the given `name`.
 | 
			
		||||
 *
 | 
			
		||||
 * @param {String} name
 | 
			
		||||
 * @return {Type}
 | 
			
		||||
 * @api public
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
function debug(name) {
 | 
			
		||||
  function disabled(){}
 | 
			
		||||
  disabled.enabled = false;
 | 
			
		||||
 | 
			
		||||
  var match = skips.some(function(re){
 | 
			
		||||
    return re.test(name);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  if (match) return disabled;
 | 
			
		||||
 | 
			
		||||
  match = names.some(function(re){
 | 
			
		||||
    return re.test(name);
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  if (!match) return disabled;
 | 
			
		||||
  var c = color();
 | 
			
		||||
 | 
			
		||||
  function colored(fmt) {
 | 
			
		||||
    var curr = new Date;
 | 
			
		||||
    var ms = curr - (prev[name] || curr);
 | 
			
		||||
    prev[name] = curr;
 | 
			
		||||
 | 
			
		||||
    fmt = '  \u001b[9' + c + 'm' + name + ' '
 | 
			
		||||
      + '\u001b[3' + c + 'm\u001b[90m'
 | 
			
		||||
      + fmt + '\u001b[3' + c + 'm'
 | 
			
		||||
      + ' +' + humanize(ms) + '\u001b[0m';
 | 
			
		||||
 | 
			
		||||
    console.error.apply(this, arguments);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function plain(fmt) {
 | 
			
		||||
    fmt = new Date().toUTCString()
 | 
			
		||||
      + ' ' + name + ' ' + fmt;
 | 
			
		||||
    console.error.apply(this, arguments);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  colored.enabled = plain.enabled = true;
 | 
			
		||||
 | 
			
		||||
  return isatty || process.env.DEBUG_COLORS
 | 
			
		||||
    ? colored
 | 
			
		||||
    : plain;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										36
									
								
								node_modules/jsonp/node_modules/debug/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								node_modules/jsonp/node_modules/debug/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "debug",
 | 
			
		||||
  "version": "0.7.2",
 | 
			
		||||
  "repository": {
 | 
			
		||||
    "type": "git",
 | 
			
		||||
    "url": "git://github.com/visionmedia/debug.git"
 | 
			
		||||
  },
 | 
			
		||||
  "description": "small debugging utility",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "debug",
 | 
			
		||||
    "log",
 | 
			
		||||
    "debugger"
 | 
			
		||||
  ],
 | 
			
		||||
  "author": {
 | 
			
		||||
    "name": "TJ Holowaychuk",
 | 
			
		||||
    "email": "tj@vision-media.ca"
 | 
			
		||||
  },
 | 
			
		||||
  "dependencies": {},
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "mocha": "*"
 | 
			
		||||
  },
 | 
			
		||||
  "main": "lib/debug.js",
 | 
			
		||||
  "browserify": "debug.js",
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "node": "*"
 | 
			
		||||
  },
 | 
			
		||||
  "component": {
 | 
			
		||||
    "scripts": {
 | 
			
		||||
      "debug/index.js": "index.js",
 | 
			
		||||
      "debug/debug.js": "debug.js"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "readme": "\n# debug\n\n  tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n  , http = require('http')\n  , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n  debug(req.method + ' ' + req.url);\n  res.end('hello\\n');\n}).listen(3000, function(){\n  debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n  debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n  \n\n  \n\n## Millisecond diff\n\n  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n  \n\n  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n  \n  \n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n  The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n  You can also exclude specific debuggers by prefixing them with a \"-\" character.  For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n  a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n  a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
 | 
			
		||||
  "_id": "debug@0.7.2",
 | 
			
		||||
  "_from": "debug@*"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										19
									
								
								node_modules/jsonp/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								node_modules/jsonp/package.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "jsonp",
 | 
			
		||||
  "description": "A sane JSONP implementation.",
 | 
			
		||||
  "version": "0.0.3",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "debug": "*"
 | 
			
		||||
  },
 | 
			
		||||
  "component": {
 | 
			
		||||
    "scripts": {
 | 
			
		||||
      "jsonp": "jsonp.js"
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "readme": "\n# jsonp\n\nA simple JSONP implementation.\n\n## API\n\n### jsonp(url, opts, fn)\n\n- `url` (`String`) url to fetch\n- `opts` (`Object`), optional\n  - `param` (`String`) name of the query string component to specify\n    the callback (defaults to `callback`)\n  - `timeout` (`Number`) how long after a timeout error is emitted. `0` to\n    disable (defaults to `60000`)\n- `fn` callback\n\nThe callback is called with `err, data` parameters. \n\nIf it times out, the `err` will be an `Error` object whose `message` is\n`Timeout`.\n\n## License\n\nMIT\n",
 | 
			
		||||
  "_id": "jsonp@0.0.3",
 | 
			
		||||
  "dist": {
 | 
			
		||||
    "shasum": "28b5308d7fc5387509accfeecf3a80321511ce9e"
 | 
			
		||||
  },
 | 
			
		||||
  "_from": "jsonp"
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user