1.2.0 • Published 4 years ago

any-size v1.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

any-size Travis CI Build Status

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.

NPM Badge

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.