UNPKG

4.34 kBMarkdownView Raw
1# isobject [![NPM version](https://img.shields.io/npm/v/isobject.svg?style=flat)](https://www.npmjs.com/package/isobject) [![NPM monthly downloads](https://img.shields.io/npm/dm/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![NPM total downloads](https://img.shields.io/npm/dt/isobject.svg?style=flat)](https://npmjs.org/package/isobject) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/isobject.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/isobject)
2
3> Returns true if the value is an object and not an array or null.
4
5Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
6
7## Install
8
9Install with [npm](https://www.npmjs.com/):
10
11```sh
12$ npm install --save isobject
13```
14
15Use [is-plain-object](https://github.com/jonschlinkert/is-plain-object) if you want only objects that are created by the `Object` constructor.
16
17## Install
18
19Install with [npm](https://www.npmjs.com/):
20
21```sh
22$ npm install isobject
23```
24
25## Usage
26
27```js
28import isObject from 'isobject';
29```
30
31**True**
32
33All of the following return `true`:
34
35```js
36isObject({});
37isObject(Object.create({}));
38isObject(Object.create(Object.prototype));
39isObject(Object.create(null));
40isObject({});
41isObject(new Foo);
42isObject(/foo/);
43```
44
45**False**
46
47All of the following return `false`:
48
49```js
50isObject();
51isObject(function () {});
52isObject(1);
53isObject([]);
54isObject(undefined);
55isObject(null);
56```
57
58## About
59
60<details>
61<summary><strong>Contributing</strong></summary>
62
63Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
64
65</details>
66
67<details>
68<summary><strong>Running Tests</strong></summary>
69
70Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
71
72```sh
73$ npm install && npm test
74```
75
76</details>
77
78<details>
79<summary><strong>Building docs</strong></summary>
80
81_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
82
83To generate the readme, run the following command:
84
85```sh
86$ npm install -g verbose/verb#dev verb-generate-readme && verb
87```
88
89</details>
90
91### Related projects
92
93You might also be interested in these projects:
94
95* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.")
96* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
97* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
98* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep "Recursively merge values in a javascript object.")
99
100### Contributors
101
102| **Commits** | **Contributor** |
103| --- | --- |
104| 30 | [jonschlinkert](https://github.com/jonschlinkert) |
105| 8 | [doowb](https://github.com/doowb) |
106| 7 | [TrySound](https://github.com/TrySound) |
107| 3 | [onokumus](https://github.com/onokumus) |
108| 1 | [LeSuisse](https://github.com/LeSuisse) |
109| 1 | [tmcw](https://github.com/tmcw) |
110| 1 | [ZhouHansen](https://github.com/ZhouHansen) |
111
112### Author
113
114**Jon Schlinkert**
115
116* [GitHub Profile](https://github.com/jonschlinkert)
117* [Twitter Profile](https://twitter.com/jonschlinkert)
118* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
119
120### License
121
122Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
123Released under the [MIT License](LICENSE).
124
125***
126
127_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 28, 2019._
\No newline at end of file