Sha256: 21cd72c6fc6adb2a2f583876daaf04f690bcc9754ec742e361b6177348b5a654

Contents?: true

Size: 602 Bytes

Versions: 34

Compression:

Stored size: 602 Bytes

Contents

'use strict';

// callback(err, data)
function externalRequest(transport, options, callback) {
    const request = transport.get(options, function (response) {
        let data = '';
        response.on('data', function (chunk) {
            data += chunk;
        });
        response.on('end', function () {
            if (response.statusCode === 200) {
                callback(null, data);
            } else {
                callback(new Error(data));
            }
        });
    });
    request.on('error', function (err) {
        callback(err);
    });
}

module.exports = externalRequest;

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
opal-1.6.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.6.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.6.0.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.6.0.alpha1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.5.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.5.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.5.0.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.4.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.4.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.4.0.alpha1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.3.2 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.3.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.3.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.3.0.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.3.0.alpha1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.2.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.2.0.beta1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.1.1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.1.1.rc1 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js
opal-1.1.0 lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js