How to use intel - 10 common examples

To help you get started, we’ve selected a few intel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sitespeedio / browsertime / lib / android / index.js View on Github external
'use strict';

const adb = require('adbkit');
const get = require('lodash.get');
const fs = require('fs');
const execa = require('execa');
const log = require('intel').getLogger('browsertime.android');

class Android {
  constructor(options) {
    this.client = adb.createClient();
    this.id = get(options, 'chrome.android.deviceSerial');
    this.port = options.devToolsPort;
  }

  async initConnection() {
    if (!this.id) {
      const devices = await this.client.listDevices();
      // just take the first phone online
      this.id = devices[0].id;
    }

    this.sdcard = await this._runCommandAndGet('echo $EXTERNAL_STORAGE');
github sitespeedio / browsertime / lib / video / screenRecording / firefox / firefoxWindowRecorder.js View on Github external
'use strict';

const log = require('intel').getLogger('browsertime.video');
const util = require('util');
const fs = require('fs');
const path = require('path');
const execa = require('execa');
const del = require('del');

const unlink = util.promisify(fs.unlink);

async function enableWindowRecorder(enable, browser) {
  if (enable) {
    enable = 'true';
  } else {
    enable = 'false';
  }

  // We wrap windowUtils.setCompositionRecording(...) in Promise.resolve() to
github sitespeedio / sitespeed.io / lib / plugins / s3 / index.js View on Github external
'use strict';

const fs = require('fs-extra');
const path = require('path');
const AWS = require('aws-sdk');
const readdir = require('recursive-readdir');
const pLimit = require('p-limit');

const log = require('intel').getLogger('sitespeedio.plugin.s3');
const throwIfMissing = require('../../support/util').throwIfMissing;
const { getContentType } = require('./contentType');

function createS3(s3Options) {
  let endpoint = s3Options.endpoint || 's3.amazonaws.com';
  const options = {
    endpoint: new AWS.Endpoint(endpoint),
    accessKeyId: s3Options.key,
    secretAccessKey: s3Options.secret,
    signatureVersion: 'v4'
  };
  // You can also set some extra options see
  // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property
  Object.assign(options, s3Options.options);
  return new AWS.S3(options);
}
github sitespeedio / browsertime / lib / video / screenRecording / setOrangeBackground.js View on Github external
'use strict';

const log = require('intel').getLogger('browsertime.video');

module.exports = async function(driver) {
  log.debug('Add orange color');
  // We tried other ways for Android (access an orange page)
  // That works fine ... but break scripts
  // https://github.com/sitespeedio/browsertime/issues/802
  const orangeScript = `
      (function() {
        const orange = document.createElement('div');
        orange.id = 'browsertime-orange';
        orange.style.position = 'absolute';
        orange.style.top = '0';
        orange.style.left = '0';
        orange.style.width = Math.max(document.documentElement.clientWidth, document.body.clientWidth) + 'px';
        orange.style.height = Math.max(document.documentElement.clientHeight,document.body.clientHeight) + 'px';
        orange.style.backgroundColor = '#DE640D';
github sitespeedio / browsertime / lib / video / postprocessing / visualmetrics / single / getVideoMetrics.js View on Github external
'use strict';

const visualMetrics = require('./visualMetrics');
const extraMetrics = require('../extraMetrics');
const log = require('intel').getLogger('browsertime.video');
const path = require('path');

module.exports = async function(
  videoDir,
  videoPath,
  index,
  visualElements, // results.browserScripts.pageinfo.visualElements
  storageManager,
  pageNumber,
  visitedPageNumber,
  options
) {
  log.debug('Running visualMetrics');
  // If we want to use the Hero functionality of Visual Metrics
  // we need to create the hero JSON file.
  if (options.visualElements && visualElements) {
github sitespeedio / browsertime / lib / support / preURL.js View on Github external
'use strict';

const log = require('intel').getLogger('browsertime');
const delay = ms => new Promise(res => setTimeout(res, ms));

module.exports = async function(browser, options) {
  log.info('Accessing preURL %s', options.preURL);
  await browser.loadAndWait(options.preURL);
  await delay(options.preURLDelay ? options.preURLDelay : 1500);
};
github bem-archive / bem-site-engine / src / data / lib / logger.js View on Github external
module.exports = function(module) {
    var name = module ? module.filename.split('/').slice(-2).join('/') : '';
    return intel.getLogger(name);
};
github bem-archive / bem-site-engine / src / blocks / server.blocks / logger / logger.node.js View on Github external
provide(function(module) {
        var name = module ? module.filename.split('/').slice(-2).join('/') : '';
        return intel.getLogger(name);
    });
});
github bem-archive / bem-site-engine / src / scripts / data_compiler / lib / logger.js View on Github external
module.exports = function(module) {
    var name = module ? module.filename.split('/').slice(-2).join('/') : '';
    return intel.getLogger(name);
};
github sitespeedio / browsertime / lib / video / screenRecording / android / convertToFps.js View on Github external
'use strict';

const execa = require('execa');
const log = require('intel').getLogger('browsertime.video');

module.exports = async function(src, dest, framerate) {
  const scriptArgs = ['-nostdin', '-i', src, '-r', framerate, dest];
  log.info('Converting video to %s fps', framerate);
  return execa('ffmpeg', scriptArgs);
};

intel

I need more intel.

MPL-2.0
Latest version published 7 years ago

Package Health Score

47 / 100
Full package analysis

Popular intel functions