aboutsummaryrefslogtreecommitdiff
path: root/node_modules/timers-browserify
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-05-03 15:35:00 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-05-03 15:35:00 +0200
commitde98e0b232509d5f40c135d540a70e415272ff85 (patch)
treea79222a5b58484ab3b80d18efcaaa7ccc4769b33 /node_modules/timers-browserify
parente0c9d480a73fa629c1e4a47d3e721f1d2d345406 (diff)
node_modules
Diffstat (limited to 'node_modules/timers-browserify')
-rw-r--r--node_modules/timers-browserify/.npmignore2
-rw-r--r--node_modules/timers-browserify/CHANGELOG.md88
-rw-r--r--node_modules/timers-browserify/LICENSE.md46
-rw-r--r--node_modules/timers-browserify/README.md40
-rw-r--r--node_modules/timers-browserify/main.js53
-rw-r--r--node_modules/timers-browserify/package.json52
6 files changed, 281 insertions, 0 deletions
diff --git a/node_modules/timers-browserify/.npmignore b/node_modules/timers-browserify/.npmignore
new file mode 100644
index 000000000..a387873da
--- /dev/null
+++ b/node_modules/timers-browserify/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+example
diff --git a/node_modules/timers-browserify/CHANGELOG.md b/node_modules/timers-browserify/CHANGELOG.md
new file mode 100644
index 000000000..5020a1ebf
--- /dev/null
+++ b/node_modules/timers-browserify/CHANGELOG.md
@@ -0,0 +1,88 @@
+# 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.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
diff --git a/node_modules/timers-browserify/LICENSE.md b/node_modules/timers-browserify/LICENSE.md
new file mode 100644
index 000000000..940ec90a7
--- /dev/null
+++ b/node_modules/timers-browserify/LICENSE.md
@@ -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.
diff --git a/node_modules/timers-browserify/README.md b/node_modules/timers-browserify/README.md
new file mode 100644
index 000000000..c7efa1921
--- /dev/null
+++ b/node_modules/timers-browserify/README.md
@@ -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/)
diff --git a/node_modules/timers-browserify/main.js b/node_modules/timers-browserify/main.js
new file mode 100644
index 000000000..001c63190
--- /dev/null
+++ b/node_modules/timers-browserify/main.js
@@ -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;
diff --git a/node_modules/timers-browserify/package.json b/node_modules/timers-browserify/package.json
new file mode 100644
index 000000000..be72f1df7
--- /dev/null
+++ b/node_modules/timers-browserify/package.json
@@ -0,0 +1,52 @@
+{
+ "author": "J. Ryan Stinnett <jryans@gmail.com> (http://convolv.es/)",
+ "name": "timers-browserify",
+ "description": "timers module for browserify",
+ "version": "2.0.2",
+ "homepage": "https://github.com/jryans/timers-browserify",
+ "bugs": "https://github.com/jryans/timers-browserify/issues",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jryans/timers-browserify.git"
+ },
+ "contributors": [
+ "Colton Brown <coltonTB@me.com>",
+ "Guy Bedford <guybedford@gmail.com>",
+ "Ionut-Cristian Florescu <ionut.florescu@gmail.com>",
+ "James Halliday <mail@substack.net>",
+ "Jan Schär <jscissr@gmail.com>",
+ "Johannes Ewald <johannes.ewald@peerigon.com>",
+ "Jonathan Prins <jon@blip.tv>",
+ "Matt Esch <matt@mattesch.info>"
+ ],
+ "main": "main.js",
+ "dependencies": {
+ "setimmediate": "^1.0.4"
+ },
+ "devDependencies": {
+ "connect": "~2.3.0",
+ "browserify": "~1.10.16"
+ },
+ "optionalDependencies": {},
+ "engines": {
+ "node": ">=0.6.0"
+ },
+ "keywords": [
+ "timers",
+ "browserify",
+ "browser"
+ ],
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/jryans/timers-browserify/blob/master/LICENSE.md"
+ }
+ ],
+ "jspm": {
+ "map": {
+ "./main.js": {
+ "node": "@node/timers"
+ }
+ }
+ }
+}