Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,2 @@
node_modules
example

View File

@@ -0,0 +1,102 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 2.0.4 - 2017-08-14
### Fixed
* Revert `setImmediate` and `clearImmediate` changes from 2.0.3 because they
appear to break Webpack.
### 2.0.3 - 2017-07-31
### Fixed
* `setImmediate` and `clearImmediate` are indirected through the `global` module
for better coverage of esoteric environments.
## 2.0.2 - 2016-10-19
### Added
* `.npmignore` now excludes example scripts, reducing package size
## 2.0.1 - 2016-06-21
### Fixed
* `clearTimeout` and `clearInterval` no longer throws when passed null or
undefined instead of the timeout token.
## 2.0.0 - 2016-03-28
### Changed
* `setImmediate` and `clearImmediate` now use the `setimmediate` module which
has better cross-browser coverage. In particular, it resolves a crash in
Safari. The `setimmediate` module adds these methods to the global
immediately, so a major version bump seems safest.
## 1.4.2 - 2015-12-08
### Added
* Metadata used by `jspm` in `package.json`
## 1.4.1 - 2015-05-10
### Changed
* Update `process` dependency
## 1.4.0 - 2015-02-23
### Added
* Link to `timers-browserify-full`, which offers a larger, but much more exact,
version of Node's `timers` library
### Changed
* `setTimeout` and `setInterval` return objects with the same API as the Node
implementation, instead of just IDs
### Fixed
* `active` implementation actually has an effect, as in Node
* Replaced usages of `apply` that break in IE 8
## 1.3.0 - 2015-02-04
### Changed
* Prefer native versions of `setImmediate` and `clearImmediate` if they exist
## 1.2.0 - 2015-01-02
### Changed
* Update `process` dependency
## 1.1.0 - 2014-08-26
### Added
* `clearImmediate` available to undo `setImmediate`
## 1.0.3 - 2014-06-30
### Fixed
* Resume returning opaque IDs from `setTimeout` and `setInterval`
## 1.0.2 - 2014-06-30
### Fixed
* Pass `window` explicitly to `setTimeout` and others to resolve an error in
Chrome
## 1.0.1 - 2013-12-28
### Changed
* Replaced `setimmediate` dependency with `process` for the `nextTick` shim
## 1.0.0 - 2013-12-10
### Added
* Guard against undefined globals like `setTimeout` in some environments
## 0.0.0 - 2012-05-30
### Added
* Basic functionality for initial release

View File

@@ -0,0 +1,46 @@
# timers-browserify
This project uses the [MIT](http://jryans.mit-license.org/) license:
Copyright © 2012 J. Ryan Stinnett <jryans@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the “Software”),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
# lib/node
The `lib/node` directory borrows files from joyent/node which uses the following license:
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
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.

View File

@@ -0,0 +1,40 @@
# Overview
Adds support for the `timers` module to browserify.
## Wait, isn't it already supported in the browser?
The public methods of the `timers` module are:
* `setTimeout(callback, delay, [arg], [...])`
* `clearTimeout(timeoutId)`
* `setInterval(callback, delay, [arg], [...])`
* `clearInterval(intervalId)`
and indeed, browsers support these already.
## So, why does this exist?
The `timers` module also includes some private methods used in other built-in
Node.js modules:
* `enroll(item, delay)`
* `unenroll(item)`
* `active(item)`
These are used to efficiently support a large quantity of timers with the same
timeouts by creating only a few timers under the covers.
Node.js also offers the `immediate` APIs, which aren't yet available cross-browser, so we polyfill those:
* `setImmediate(callback, [arg], [...])`
* `clearImmediate(immediateId)`
## I need lots of timers and want to use linked list timers as Node.js does.
Linked lists are efficient when you have thousands (millions?) of timers with the same delay.
Take a look at [timers-browserify-full](https://www.npmjs.com/package/timers-browserify-full) in this case.
# License
[MIT](http://jryans.mit-license.org/)

View File

@@ -0,0 +1,53 @@
var apply = Function.prototype.apply;
// DOM APIs, for completeness
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) {
if (timeout) {
timeout.close();
}
};
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
this._clearFn.call(window, this._id);
};
// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function(item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function(item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout)
item._onTimeout();
}, msecs);
}
};
// setimmediate attaches itself to the global object
require("setimmediate");
exports.setImmediate = setImmediate;
exports.clearImmediate = clearImmediate;

View File

@@ -0,0 +1,118 @@
{
"_args": [
[
"timers-browserify@2.0.4",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "timers-browserify@2.0.4",
"_id": "timers-browserify@2.0.4",
"_inBundle": false,
"_integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==",
"_location": "/webpack/timers-browserify",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "timers-browserify@2.0.4",
"name": "timers-browserify",
"escapedName": "timers-browserify",
"rawSpec": "2.0.4",
"saveSpec": null,
"fetchSpec": "2.0.4"
},
"_requiredBy": [
"/webpack/node-libs-browser"
],
"_resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz",
"_spec": "2.0.4",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "J. Ryan Stinnett",
"email": "jryans@gmail.com",
"url": "http://convolv.es/"
},
"bugs": {
"url": "https://github.com/jryans/timers-browserify/issues"
},
"contributors": [
{
"name": "Colton Brown",
"email": "coltonTB@me.com"
},
{
"name": "Guy Bedford",
"email": "guybedford@gmail.com"
},
{
"name": "Ionut-Cristian Florescu",
"email": "ionut.florescu@gmail.com"
},
{
"name": "James Halliday",
"email": "mail@substack.net"
},
{
"name": "Jan Schär",
"email": "jscissr@gmail.com"
},
{
"name": "Johannes Ewald",
"email": "johannes.ewald@peerigon.com"
},
{
"name": "Jonathan Prins",
"email": "jon@blip.tv"
},
{
"name": "Matt Esch",
"email": "matt@mattesch.info"
},
{
"name": "taoqf",
"email": "tao_qiufeng@126.com"
},
{
"name": "wtgtybhertgeghgtwtg",
"email": "wtgtybhertgeghgtwtg@gmail.com"
}
],
"dependencies": {
"setimmediate": "^1.0.4"
},
"description": "timers module for browserify",
"devDependencies": {
"browserify": "~1.10.16",
"connect": "~2.3.0"
},
"engines": {
"node": ">=0.6.0"
},
"homepage": "https://github.com/jryans/timers-browserify",
"jspm": {
"map": {
"./main.js": {
"node": "@node/timers"
}
}
},
"keywords": [
"timers",
"browserify",
"browser"
],
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jryans/timers-browserify/blob/master/LICENSE.md"
}
],
"main": "main.js",
"name": "timers-browserify",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git://github.com/jryans/timers-browserify.git"
},
"version": "2.0.4"
}