@davebaol/length-of

1.0.0 • Public • Published

length-of Build Status dependencies Status devDependencies Status License: MIT

Get the length of its argument, i.e. the number of items of an array, characters of a string or properties of an object; undefined otherwise.

Install with npm

npm i @davebaol/length-of --save

Usage

var lengthOf = require('@davebaol/length-of');

lengthOf({a: 'a', b: 'b'});
//=> 2

lengthOf('length-of');
//=> 9

lengthOf(['foo', 'bar']);
//=> 2

lengthOf(123);
//=> undefined

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Running tests

Install dev dependencies.

npm i -d && npm test

License

MIT © Davide Sessi

Package Sidebar

Install

npm i @davebaol/length-of

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.47 kB

Total Files

4

Last publish

Collaborators

  • davebaol