Socket
Socket
Sign inDemoInstall

object-count

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-count

returns the size of an array or the number of properties of an object


Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Object count

Count the number of properties in an object, or return the number of items in an array. It doesn't look up in the prototype chain.

Installation

npm install object-count

How to use

Require object-count:

var count = require("object-count");

Use it with an object:

var anObject = {
  "property1": "with",
  "property2": "some",
  "property3": "data"
};

count(anObject); // 3

It also works with an array:

var anArray = ["with", "some", "data"];

count(anArray); // 3

LICENSE

MIT

Keywords

FAQs

Package last updated on 31 Mar 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc