any-size
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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.

Package Sidebar

Install

npm i any-size

Weekly Downloads

3

Version

1.2.0

License

MIT

Unpacked Size

3.54 kB

Total Files

6

Last publish

Collaborators

  • richienb