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
Size: 120
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
0.1.3: documented the features a little more formally. Switched to a more meaningful, inoffensive name.
0.1.2: just tweaking the README.
0.1.1: just pass in your own title. Show the sizes.
0.1.0: initial release. Tests passing.