How to use the eyes.inspector function in eyes

To help you get started, we’ve selected a few eyes 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 sjlu / popular-movies / test / all.js View on Github external
/* eslint-env mocha */
var Promise = require('bluebird')
var expect = require('must')
var eyes = require('eyes')
var Index = require('../index')

var inspect = eyes.inspector({
  pretty: true,
  hideFunctions: true,
  maxLength: 0
})

describe('all', function () {
  it('should get me a list of movies', function () {
    return Promise
      .bind({
        listBuilder: new Index()
      })
      .then(function () {
        return this.listBuilder.filter()
      })
      .then(function (movies) {
        inspect(movies)
github chilts / awssum / test / integration / amazon-glacier.js View on Github external
//
// Copyright (c) 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton 
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
// requires

var fmt = require('fmt');
var fs = require('fs');
var test = require('tap').test;
var awssum = require('../../');
var amazon = awssum.load('amazon/amazon');
var Glacier = awssum.load('amazon/glacier').Glacier;
var inspect = require('eyes').inspector();

// --------------------------------------------------------------------------------------------------------------------

var env = process.env;
var glacier;
try {
    glacier = new Glacier({
        'accessKeyId'     : env.ACCESS_KEY_ID,
        'secretAccessKey' : env.SECRET_ACCESS_KEY,
        'awsAccountId'    : env.AWS_ACCOUNT_ID,
        'region'          : amazon.US_EAST_1
    });
}
catch(e) {
    // env vars aren't set, so skip these integration tests
    process.exit();
github chilts / awssum / test / integration / amazon-cloudsearch.js View on Github external
// integration/amazon-cloudsearch.js - integration tests for Amazon CloudSearch
//
// Copyright (c) 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton 
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
// requires

var fs = require('fs');
var test = require('tap').test;
var awssum = require('../../');
var amazon = awssum.load('amazon/amazon');
var CloudSearch = awssum.load('amazon/cloudsearch').CloudSearch;
var inspect = require('eyes').inspector();

// --------------------------------------------------------------------------------------------------------------------

var env = process.env;
var cs;
try {
    cs = new CloudSearch({
        'accessKeyId'     : env.ACCESS_KEY_ID,
        'secretAccessKey' : env.SECRET_ACCESS_KEY,
        'region'          : amazon.US_EAST_1
    });
}
catch(e) {
    // env vars aren't set, so skip these integration tests
    process.exit();
}
github chilts / awssum / test / integration / amazon-storagegateway.js View on Github external
// integration/amazon-storagegateway.js - integration tests for Amazon Storage Gateway
//
// Copyright (c) 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton 
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
// requires

var fs = require('fs');
var test = require('tap').test;
var awssum = require('../../');
var amazon = awssum.load('amazon/amazon');
var StorageGateway = awssum.load('amazon/storagegateway').StorageGateway;
var inspect = require('eyes').inspector();

// --------------------------------------------------------------------------------------------------------------------

var env = process.env;
var sg;
try {
    sg = new StorageGateway({
        'accessKeyId'     : env.ACCESS_KEY_ID,
        'secretAccessKey' : env.SECRET_ACCESS_KEY,
        'region'          : amazon.US_EAST_1
    });
}
catch(e) {
    // env vars aren't set, so skip these integration tests
    process.exit();
}
github tedeh / jayson / bin / jayson.js View on Github external
const program = require('commander');
const eyes = require('eyes');
const net = require('net')

// initialize program and define arguments
program.version(pkg.version)
       .option('-m, --method [name]', 'Method', String)
       .option('-p, --params [json]', 'Array or Object to use as parameters', JSON.parse)
       .option('-u, --url [url]', 'URL to server', url.parse)
       .option('-q, --quiet', 'Only output the response value and any errors', Boolean)
       .option('-s, --socket [path] or [ip:port]', 'Path to UNIX socket, or TCP socket address', parseSocket)
       .option('-j, --json', 'Only output the response value as JSON (implies --quiet)')
       .option('-c, --color', 'Color output', Boolean)
       .parse(process.argv);

const inspect = eyes.inspector({
  stream: null,
  styles: program.color ? eyes.defaults.styles : {all: false}
});

// quiet is implied if json is specified
if(program.json) program.quiet = true;

// wrapper for printing different kinds of output
const std = {
  out: getPrinter({ fn: console.log }),
  err: getPrinter({ fn: console.error })
};

// do we have all arguments required to do something?
if(!(program.method && (program.url || program.socket))) {
  std.err.result(program.helpInformation());
github nodejitsu / jitsu / lib / jitsu / log.js View on Github external
/*
 * log.js: Tools for configuring winston in jitsu.
 *
 * (C) 2010, Nodejitsu Inc.
 *
 */
 
var eyes = require('eyes'),
    winston = require('winston');

var log = exports;

log.inspect = eyes.inspector({ stream: null,
  styles: {                 // Styles applied to stdout
      all:     null,        // Overall style applied to everything
      label:   'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]`
      other:   'inverted',  // Objects which don't have a literal representation, such as functions
      key:     'grey',      // The keys in object literals, like 'a' in `{a: 1}`
      special: 'grey',      // null, undefined...
      number:  'blue',      // 0, 1, 2...
      bool:    'magenta',   // true false
      regexp:  'green',     // /\d+/
  }
});

//
// ### function extractFrom (obj, properties)
// #### @obj {Object} Object to extract properties from. 
// #### @properties {Array} List of properties to output.
github flatiron / cliff / lib / cliff.js View on Github external
logger.cli();
  }
});

//
// Set the default logger for cliff.
//
cliff.logger = new winston.Logger({
  transports: [new winston.transports.Console()]
});

//
// Expose a default `eyes` inspector.
//
cliff.inspector = eyes.inspector;
cliff.inspect   = eyes.inspector({ stream: null,
  styles: {               // Styles applied to stdout
    all:     null,        // Overall style applied to everything
    label:   'underline', // Inspection labels, like 'array' in `array: [1, 2, 3]`
    other:   'inverted',  // Objects which don't have a literal representation, such as functions
    key:     'grey',      // The keys in object literals, like 'a' in `{a: 1}`
    special: 'grey',      // null, undefined...
    number:  'blue',      // 0, 1, 2...
    bool:    'magenta',   // true false
    regexp:  'green'      // /\d+/
  }
});

//
// ### function extractFrom (obj, properties)
// #### @obj {Object} Object to extract properties from.
// #### @properties {Array} List of properties to output.
github tellnes / node-cloudfront / examples / invalidate1.js View on Github external
var cloudfront = require('..')
  , inspect = require('eyes').inspector({maxLength: -1})

var cf = cloudfront.createClient(process.env.AWS_KEY, process.env.AWS_SECRET)

// argv: distributionId, callerReference, path

cf.createInvalidation(process.argv[2], process.argv[3], process.argv.slice(4), function(err, invalidation) {
  if (err) return inspect(err)

  inspect(invalidation)
})
github vesln / logme / lib / logme.js View on Github external
continue;
    }
    this.options[key] = config[key];
  }
  
  if (this.options.theme === Object(this.options.theme)) {
    this.templates = this.options.theme;
  } else {
    this.templates = themes.get(this.options.theme);
  }
  
  if (this.templates.inspect !== void 0) {
    inspect.styles = this.templates.inspect;
  }
  
  this.inspector = eyes.inspector(inspect);
};
github sjlu / popular-movies / lib / inspect.js View on Github external
var inspect = require('eyes').inspector({
  pretty: true,
  hideFunctions: true,
  maxLength: 0
})

module.exports = inspect

eyes

a customizable value inspector

Unknown
Latest version published 12 years ago

Package Health Score

59 / 100
Full package analysis

Popular eyes functions