@cldmv/sizeofvar
v1.0.14
Published
Determines the initial memory usage of any javascript variable in NODE.JS
Maintainers
Readme
sizeofvar
Description
sizeofvar allows you to get a realistic memory size of any variable upon initialization or variable setting.
✨ What's New
Latest: v1.0.14 (October 2026)
- Vitest 5.0.3 (#39, #40) —
vitestand@vitest/coverage-v8move from 5.0.2 to 5.0.3 in the lockfile, development dependencies only. Thesizeofvar()function is unchanged and the package still has no runtime dependencies; it's a drop-in replacement for the previous version. - View full v1.0.14 Changelog
Recent Releases
- v1.0.13 (October 2026) — dev-tooling bumps:
@cldmv/fix-headers2.2.0,@cldmv/configs1.2.4 and@cldmv/vitest-runner1.5.3; no file header changed (Changelog) - v1.0.12 (October 2026) — CI only: the in-repo PR mirror job now always runs and reports under a non-required name instead of being skipped (Changelog)
- v1.0.11 (October 2026) — CI only: a skipped PR-run mirror job no longer satisfies the
✅ Required PR Checkruleset gate (Changelog) - v1.0.10 (October 2026) — workflows synced to the CLDMV/.github v4.29.2 templates, bundle-size workflow, shared fix-headers config (comment-only header in
sizeofvar.js); no runtime change (Changelog)
📚 For complete version history and detailed release notes, see the docs/changelog/ folder.
Install
npm i @cldmv/sizeofvar --saveUsage
const sizeofvar = require('@cldmv/sizeofvar');
console.log(sizeofvar(variable));Test Examples
The included tests allow you to verify that the number returned from this module represents the memory usage reported by node for a variable.
node -expose-gc test/test-mem.js command [-v]-expose-gc
This option is required to run the memory tests. Without it you will recieve an error.
test/test-mem.js
This is the test file. It handles a command to test various variable tests.
command
Valid values are:
- array
- bool
- number
- object
- object-complex
- object-key-length
- object-string
- string
❤️ Contributors
This project exists thanks to all the people who contribute. [Contributors].
