miktam / sizeof

Get size of a JavaScript object
MIT License
301 stars 45 forks source link

Function Support? #66

Closed mahsashadi closed 1 year ago

mahsashadi commented 2 years ago

Does this module support functions?

miktam commented 2 years ago

@mahsashadi no, it doesn't. PR is always welcomed!

miktam commented 1 year ago

ChatGPT has a following view on calculating the function size

chatGpt about function
const util = require('util');
const myFunction = function() {console.log("Hello World")};

const funcString = util.inspect(myFunction);
const funcSize = Buffer.byteLength(funcString, 'utf8');
console.log(funcSize);