
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
keys-length
Advanced tools
Get the length of the keys on an object. Much faster than Object.keys()
If you need the length of an object's properties, excluding prototype properties, use object-length
Install with npm
npm i keys-length --save
var len = require('keys-length');
len({a: 'b', c: 'd', e: 'f'});
//=> 3
Object.keys()#1: 2 keys
'for-in loop' x 24,570,016 ops/sec ±0.65% (93 runs sampled)
'Object.keys()' x 3,840,164 ops/sec ±0.62% (97 runs sampled)
#2: 5 keys
'for-in loop' x 22,487,684 ops/sec ±0.83% (91 runs sampled)
'Object.keys()' x 3,169,150 ops/sec ±0.59% (97 runs sampled)
#3: 10 keys
'for-in loop' x 20,201,512 ops/sec ±1.06% (94 runs sampled)
'Object.keys()' x 2,519,700 ops/sec ±0.62% (94 runs sampled)
#4: 52 keys
'for-in loop' x 10,519,640 ops/sec ±0.61% (97 runs sampled)
'Object.keys()' x 791,094 ops/sec ±0.63% (94 runs sampled)
Install dev dependencies:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright (c) 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on May 12, 2015.
FAQs
Get the length of the keys on an object. Much faster than Object.keys()
The npm package keys-length receives a total of 13 weekly downloads. As such, keys-length popularity was classified as not popular.
We found that keys-length demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.