aboutsummaryrefslogtreecommitdiff
path: root/node_modules/node-libs-browser
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/node-libs-browser
parente0c9d480a73fa629c1e4a47d3e721f1d2d345406 (diff)
node_modules
Diffstat (limited to 'node_modules/node-libs-browser')
-rw-r--r--node_modules/node-libs-browser/LICENSE22
-rw-r--r--node_modules/node-libs-browser/README.md61
-rw-r--r--node_modules/node-libs-browser/index.js38
-rw-r--r--node_modules/node-libs-browser/mock/buffer.js10
-rw-r--r--node_modules/node-libs-browser/mock/console.js12
-rw-r--r--node_modules/node-libs-browser/mock/dns.js15
-rw-r--r--node_modules/node-libs-browser/mock/empty.js0
-rw-r--r--node_modules/node-libs-browser/mock/net.js10
-rw-r--r--node_modules/node-libs-browser/mock/process.js30
-rw-r--r--node_modules/node-libs-browser/mock/punycode.js6
-rw-r--r--node_modules/node-libs-browser/mock/tls.js1
-rw-r--r--node_modules/node-libs-browser/mock/tty.js2
-rw-r--r--node_modules/node-libs-browser/package.json48
13 files changed, 255 insertions, 0 deletions
diff --git a/node_modules/node-libs-browser/LICENSE b/node_modules/node-libs-browser/LICENSE
new file mode 100644
index 000000000..b6f8f4003
--- /dev/null
+++ b/node_modules/node-libs-browser/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2012 Tobias Koppers
+
+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/node-libs-browser/README.md b/node_modules/node-libs-browser/README.md
new file mode 100644
index 000000000..a937ec4f9
--- /dev/null
+++ b/node_modules/node-libs-browser/README.md
@@ -0,0 +1,61 @@
+# node-libs-browser
+
+The node core libs for in-browser usage.
+
+[![dependencies status](http://david-dm.org/webpack/node-libs-browser.png)](http://david-dm.org/webpack/node-libs-browser)
+
+Exports a hash [object] of absolute paths to each lib, keyed by lib names. Modules without browser replacements are `null`.
+
+Some modules have mocks in the `mock` directory. These are replacements with minimal functionality.
+
+| lib name | browser implementation | mock implementation |
+|:--------:|:----------------------:|:-------------------:|
+| assert | [defunctzombie/commonjs-assert](https://github.com/defunctzombie/commonjs-assert) | --- |
+| buffer | [feross/buffer](https://github.com/feross/buffer) | [buffer.js](https://github.com/webpack/node-libs-browser/blob/master/mock/buffer.js) |
+| child_process | --- | --- |
+| cluster | --- | --- |
+| console | [Raynos/console-browserify](https://github.com/Raynos/console-browserify) | [console.js](https://github.com/webpack/node-libs-browser/blob/master/mock/console.js) |
+| constants | [juliangruber/constants-browserify](https://github.com/juliangruber/constants-browserify) | --- |
+| crypto | [crypto-browserify/crypto-browserify](https://github.com/crypto-browserify/crypto-browserify) | --- |
+| dgram | --- | --- |
+| dns | --- | [dns.js](https://github.com/webpack/node-libs-browser/blob/master/mock/dns.js) |
+| domain | [bevry/domain-browser](https://github.com/bevry/domain-browser) | --- |
+| events | [Gozala/events](https://github.com/Gozala/events) | --- |
+| fs | --- | --- |
+| http | [jhiesey/stream-http](https://github.com/jhiesey/stream-http) | --- |
+| https | [substack/https-browserify](https://github.com/substack/https-browserify) | --- |
+| module | --- | --- |
+| net | --- | [net.js](https://github.com/webpack/node-libs-browser/blob/master/mock/net.js) |
+| os | [CoderPuppy/os-browserify](https://github.com/CoderPuppy/os-browserify) | --- |
+| path | [substack/path-browserify](https://github.com/substack/path-browserify) | --- |
+| process | [shtylman/node-process](https://github.com/shtylman/node-process) | [process.js](https://github.com/webpack/node-libs-browser/blob/master/mock/process.js) |
+| punycode | [bestiejs/punycode.js](https://github.com/bestiejs/punycode.js) | --- |
+| querystring | [mike-spainhower/querystring](https://github.com/mike-spainhower/querystring) | --- |
+| readline | --- | --- |
+| repl | --- | --- |
+| stream | [substack/stream-browserify](https://github.com/substack/stream-browserify) | --- |
+| string_decoder | [rvagg/string_decoder](https://github.com/rvagg/string_decoder) | --- |
+| sys | [defunctzombie/node-util](https://github.com/defunctzombie/node-util) | --- |
+| timers | [jryans/timers-browserify](https://github.com/jryans/timers-browserify) | --- |
+| tls | --- | [tls.js](https://github.com/webpack/node-libs-browser/blob/master/mock/tls.js) |
+| tty | [substack/tty-browserify](https://github.com/substack/tty-browserify) | [tty.js](https://github.com/webpack/node-libs-browser/blob/master/mock/tty.js) |
+| url | [defunctzombie/node-url](https://github.com/defunctzombie/node-url) | --- |
+| util | [defunctzombie/node-util](https://github.com/defunctzombie/node-util) | --- |
+| vm | [substack/vm-browserify](https://github.com/substack/vm-browserify) | --- |
+| zlib | [devongovett/browserify-zlib](https://github.com/devongovett/browserify-zlib) | --- |
+
+## Outdated versions
+
+### `buffer`
+
+The current `buffer` implementation uses feross/buffer@4.x because feross/buffer@5.x relies on [typed arrays](https://github.com/feross/buffer/commit/5daca86b7cd5d2b8ccb167534d47421029f639e9#commitcomment-19698936).
+This will be dropped as soon as IE9 is not a typical browser target anymore.
+
+### `punycode`
+
+The current `punycode` implementation uses bestiejs/punycode.js@1.x because bestiejs/punycode.js@2.x requires modern JS engines that understand `const` and `let`.
+It will be removed someday since it has already been [deprecated from the node API](https://nodejs.org/api/punycode.html).
+
+## License
+
+MIT
diff --git a/node_modules/node-libs-browser/index.js b/node_modules/node-libs-browser/index.js
new file mode 100644
index 000000000..23c3185d0
--- /dev/null
+++ b/node_modules/node-libs-browser/index.js
@@ -0,0 +1,38 @@
+exports.assert = require.resolve('assert/');
+exports.buffer = require.resolve('buffer/');
+exports.child_process = null;
+exports.cluster = null;
+exports.console = require.resolve('console-browserify');
+exports.constants = require.resolve('constants-browserify');
+exports.crypto = require.resolve('crypto-browserify');
+exports.dgram = null;
+exports.dns = null;
+exports.domain = require.resolve('domain-browser');
+exports.events = require.resolve('events/');
+exports.fs = null;
+exports.http = require.resolve('stream-http');
+exports.https = require.resolve('https-browserify');
+exports.module = null;
+exports.net = null;
+exports.os = require.resolve('os-browserify/browser.js');
+exports.path = require.resolve('path-browserify');
+exports.punycode = require.resolve('punycode/');
+exports.process = require.resolve('process/browser.js');
+exports.querystring = require.resolve('querystring-es3/');
+exports.readline = null;
+exports.repl = null;
+exports.stream = require.resolve('stream-browserify');
+exports._stream_duplex = require.resolve('readable-stream/duplex.js');
+exports._stream_passthrough = require.resolve('readable-stream/passthrough.js');
+exports._stream_readable = require.resolve('readable-stream/readable.js');
+exports._stream_transform = require.resolve('readable-stream/transform.js');
+exports._stream_writable = require.resolve('readable-stream/writable.js');
+exports.string_decoder = require.resolve('string_decoder/');
+exports.sys = require.resolve('util/util.js');
+exports.timers = require.resolve('timers-browserify');
+exports.tls = null;
+exports.tty = require.resolve('tty-browserify');
+exports.url = require.resolve('url/');
+exports.util = require.resolve('util/util.js');
+exports.vm = require.resolve('vm-browserify');
+exports.zlib = require.resolve('browserify-zlib');
diff --git a/node_modules/node-libs-browser/mock/buffer.js b/node_modules/node-libs-browser/mock/buffer.js
new file mode 100644
index 000000000..76a2d1818
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/buffer.js
@@ -0,0 +1,10 @@
+function Buffer() {
+ throw new Error("Buffer is not included.");
+}
+Buffer.isBuffer = function() {
+ return false;
+};
+
+exports.INSPECT_MAX_BYTES = 50;
+exports.SlowBuffer = Buffer;
+exports.Buffer = Buffer;
diff --git a/node_modules/node-libs-browser/mock/console.js b/node_modules/node-libs-browser/mock/console.js
new file mode 100644
index 000000000..2bc7d5f96
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/console.js
@@ -0,0 +1,12 @@
+var console;
+if (typeof global !== "undefined" && global.console) {
+ console = global.console
+} else if (typeof window !== "undefined" && window.console) {
+ console = window.console
+} else {
+ console = window.console = {}
+}
+module.exports = console;
+for(var name in {log:1, info:1, error:1, warn:1, dir:1, trace:1, assert:1, time:1, timeEnd: 1})
+ if(!console[name])
+ console[name] = function() {};
diff --git a/node_modules/node-libs-browser/mock/dns.js b/node_modules/node-libs-browser/mock/dns.js
new file mode 100644
index 000000000..f15a0040e
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/dns.js
@@ -0,0 +1,15 @@
+exports.lookup = exports.resolve4 =
+exports.resolve6 = exports.resolveCname =
+exports.resolveMx = exports.resolveNs =
+exports.resolveTxt = exports.resolveSrv =
+exports.resolveNaptr = exports.reverse =
+exports.resolve =
+function () {
+ if (!arguments.length) return;
+
+ var callback = arguments[arguments.length - 1];
+ if (callback && typeof callback === 'function') {
+ callback(null, '0.0.0.0')
+ }
+}
+
diff --git a/node_modules/node-libs-browser/mock/empty.js b/node_modules/node-libs-browser/mock/empty.js
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/empty.js
diff --git a/node_modules/node-libs-browser/mock/net.js b/node_modules/node-libs-browser/mock/net.js
new file mode 100644
index 000000000..e42afc709
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/net.js
@@ -0,0 +1,10 @@
+exports.createServer =
+exports.createConnection =
+exports.connect =
+function () {};
+
+exports.isIP =
+exports.isIPv4 =
+exports.isIPv6 =
+function () { return true };
+
diff --git a/node_modules/node-libs-browser/mock/process.js b/node_modules/node-libs-browser/mock/process.js
new file mode 100644
index 000000000..04f795974
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/process.js
@@ -0,0 +1,30 @@
+exports.nextTick = function nextTick(fn) {
+ setTimeout(fn, 0);
+};
+
+exports.platform = exports.arch =
+exports.execPath = exports.title = 'browser';
+exports.pid = 1;
+exports.browser = true;
+exports.env = {};
+exports.argv = [];
+
+exports.binding = function (name) {
+ throw new Error('No such module. (Possibly not yet loaded)')
+};
+
+(function () {
+ var cwd = '/';
+ var path;
+ exports.cwd = function () { return cwd };
+ exports.chdir = function (dir) {
+ if (!path) path = require('path');
+ cwd = path.resolve(dir, cwd);
+ };
+})();
+
+exports.exit = exports.kill =
+exports.umask = exports.dlopen =
+exports.uptime = exports.memoryUsage =
+exports.uvCounters = function() {};
+exports.features = {};
diff --git a/node_modules/node-libs-browser/mock/punycode.js b/node_modules/node-libs-browser/mock/punycode.js
new file mode 100644
index 000000000..9f964a173
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/punycode.js
@@ -0,0 +1,6 @@
+exports.ucs2 = {};
+exports.encode = exports.decode =
+exports.ucs2.encode = exports.ucs2.decode =
+exports.toUnicode = exports.toASCII =
+function (s) { return s };
+exports.version = "0.0.0"; \ No newline at end of file
diff --git a/node_modules/node-libs-browser/mock/tls.js b/node_modules/node-libs-browser/mock/tls.js
new file mode 100644
index 000000000..65b3dba38
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/tls.js
@@ -0,0 +1 @@
+// todo
diff --git a/node_modules/node-libs-browser/mock/tty.js b/node_modules/node-libs-browser/mock/tty.js
new file mode 100644
index 000000000..a674e0f7a
--- /dev/null
+++ b/node_modules/node-libs-browser/mock/tty.js
@@ -0,0 +1,2 @@
+exports.isatty = function () {};
+exports.setRawMode = function () {};
diff --git a/node_modules/node-libs-browser/package.json b/node_modules/node-libs-browser/package.json
new file mode 100644
index 000000000..6f0d2bff4
--- /dev/null
+++ b/node_modules/node-libs-browser/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "node-libs-browser",
+ "version": "2.0.0",
+ "author": "Tobias Koppers @sokra",
+ "description": "The node core libs for in browser usage.",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/webpack/node-libs-browser.git"
+ },
+ "dependencies": {
+ "assert": "^1.1.1",
+ "browserify-zlib": "^0.1.4",
+ "buffer": "^4.3.0",
+ "console-browserify": "^1.1.0",
+ "constants-browserify": "^1.0.0",
+ "crypto-browserify": "^3.11.0",
+ "domain-browser": "^1.1.1",
+ "events": "^1.0.0",
+ "https-browserify": "0.0.1",
+ "os-browserify": "^0.2.0",
+ "path-browserify": "0.0.0",
+ "process": "^0.11.0",
+ "punycode": "^1.2.4",
+ "querystring-es3": "^0.2.0",
+ "readable-stream": "^2.0.5",
+ "stream-browserify": "^2.0.1",
+ "stream-http": "^2.3.1",
+ "string_decoder": "^0.10.25",
+ "timers-browserify": "^2.0.2",
+ "tty-browserify": "0.0.0",
+ "url": "^0.11.0",
+ "util": "^0.10.3",
+ "vm-browserify": "0.0.4"
+ },
+ "homepage": "http://github.com/webpack/node-libs-browser",
+ "main": "index.js",
+ "files": [
+ "index.js",
+ "mock/"
+ ],
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/webpack/node-libs-browser/issues"
+ }
+}