punkave/find-big-objects

Name: find-big-objects

Owner: P'unk Avenue

Description: Find big objects and print out dot paths to the properties that contribute to their size.

Created: 2015-07-22 20:41:09.0

Updated: 2015-08-11 15:49:36.0

Pushed: 2015-07-28 20:17:01.0

Homepage:

Size: 120

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

find-big-objects

This code:

findBigObjects = require('find-big-objects');

small = {
tle: 'small',
isObjectIs: 'really small'



BigObjects(small, small.title, 50000);
o output produced here

big = {
tle: 'big',
: {
thing: {
  is: {
    huge: 'huge '
  }
}

her: 'not so big property'


i;
(i = 0; (i < 16); i++) {
g.my.thing.is.huge += big.my.thing.is.huge;


BigObjects(big, big.title, 50000);

Produces this output on the console:

(327765) :
(327708)
.thing(327698)
.thing.is(327691)
.thing.is.huge(327682)

The first argument is your object. The second argument is a label to display if your object is too large. The third argument is the number of bytes considered to be “too large;” anything with a JSON representation that large or larger will generate output.

You can also pass your own output function as the last argument. The output function is a simple synchronous function that takes a string and is expected to add a newline on its own.

Changelog

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.