rough-object-size
v1.0.3
Published
return size of object
Downloads
19,392
Readme
return max object size
Usage
use OBJECT_SIZE_MAX_LOOPS to change the default 1000 iteration loop
const { roughObjectSize } = require('rough-object-size');
const circular = {
ok: 1,
};
const object = {
circular,
val: 1,
};
circular.object = circular;
roughObjectSize(object) === 16
const object = {
bool: true,
alon: 1,
shimon: 'shimon',
arr: [1],
another: {
wow: [1, 2, 3],
},
};
roughObjectSize(object) ===(4 + 8 + 6 * 2 + 8 + 3 * 8);