any-size
v1.2.0
Published
Get the size of a value.
Downloads
11
Maintainers
Readme
any-size
Get the size of a value. Supports objects, array-like values, strings (with ansi stripping and unicode character recognition), numbers, bigints, maps, sets and array buffers.
Install
npm install any-size
Usage
const size = require("any-size")
size("unicorns")
//=> 8
size([1, 2, 3, 4, 5])
//=> 5
size({a: 1, b: 2, c: 3})
//=> 3
API
anySize(input)
input
Type: any
The value to get the size of.