rough-object-size

1.0.3 • Public • Published

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);

Readme

Keywords

Package Sidebar

Install

npm i rough-object-size

Weekly Downloads

3,702

Version

1.0.3

License

Apache-2.0

Unpacked Size

16.7 kB

Total Files

7

Last publish

Collaborators

  • mad_vinking