# @risan/is-plain-obj

> Check if a value is a plain JavaScript object.

Latest version **1.0.7** (published 2018-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @risan/is-plain-obj
pnpm add @risan/is-plain-obj
yarn add @risan/is-plain-obj
bun add @risan/is-plain-obj
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2018-12-10 |
| First published | 2018-11-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Risan Bagja Pradana |
| Maintainers | risan |
| Keywords | object, object-literal, plain-object |

## Links

- npm: https://www.npmjs.com/package/@risan/is-plain-obj
- Repository: https://github.com/risan/is-plain-obj
- Homepage: https://github.com/risan/is-plain-obj#readme
- Issues: https://github.com/risan/is-plain-obj/issues
- npm.io page: https://npm.io/package/@risan/is-plain-obj

## Recent versions

- 1.0.7 (latest) — 2018-12-10
- 1.0.6 — 2018-12-07
- 1.0.5 — 2018-12-02
- 1.0.4 — 2018-11-24
- 1.0.3 — 2018-11-24
- 1.0.2 — 2018-11-24
- 1.0.1 — 2018-11-24
- 1.0.0 — 2018-11-24

## README

# Is Plain Object

[![Build Status](https://badgen.net/travis/risan/is-plain-obj)](https://travis-ci.org/risan/is-plain-obj)
[![Test Covarage](https://badgen.net/codecov/c/github/risan/is-plain-obj)](https://codecov.io/gh/risan/is-plain-obj)
[![Greenkeeper](https://badges.greenkeeper.io/risan/is-plain-obj.svg)](https://greenkeeper.io)
[![Latest Version](https://badgen.net/npm/v/@risan/is-plain-obj)](https://www.npmjs.com/package/@risan/is-plain-obj)

Check if a value is a plain JavaScript object

## Installation

```bash
$ npm install @risan/is-plain-obj
```

### CDN

The library is available over a CDN:

```html
<script src="https://unpkg.com/@risan/is-plain-obj@latest/dist/is-plain-obj.umd.js"></script>

<!-- Or the minified version -->
<script src="https://unpkg.com/@risan/is-plain-obj@latest/dist/is-plain-obj.umd.min.js"></script>
```

## Usage

```js
const isPlainObj = require("@risan/is-plain-obj");

// The following statements will return TRUE:
isPlainObj({});
isPlainObj({ foo: "bar" });
isPlainObj(new Object());
isPlainObj(Object.create(null));
isPlainObj(Object.create({}));

// The following statements will return FALSE:
isPlainObj(undefined);
isPlainObj(null);
isPlainObj(true);
isPlainObj(3.14);
isPlainObj(NaN);
isPlainObj(Infinity);
isPlainObj("foo");
isPlainObj([1, 2, 3]);
isPlainObj(new Date());
isPlainObj(new Set([1, 2, 3]));
isPlainObj(new Map());
isPlainObj(new WeakMap());
isPlainObj(parseInt);

class Person {}
isPlainObj(new Person()); // FALSE

const myFunction = () => "foo";
isPlainObj(myFunction); // FALSE
```

If you load the library directly on the browser, it's available under the `isPlainObj` name.

```js
window.isPlainObj({ foo: "bar" }); // TRUE

window.isPlainObj(new Date()); // FALSE
```

## License

[MIT](https://github.com/risan/is-plain-obj/blob/master/LICENSE) © [Risan Bagja Pradana](https://bagja.net)

---
_Source: https://npm.io/package/@risan/is-plain-obj · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
