# has-props-js

> The library to determines whether an object has the specified properties.

Latest version **1.0.2** (published 2023-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install has-props-js
pnpm add has-props-js
yarn add has-props-js
bun add has-props-js
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-07-28 |
| First published | 2023-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | camcam2605 |
| Maintainers | camcam2605 |
| Keywords | has-own-property, has-own-properties, has property, has own, object |

## Links

- npm: https://www.npmjs.com/package/has-props-js
- Repository: https://github.com/camcam2605/has-props-js
- Homepage: https://github.com/camcam2605/has-props-js.git
- Issues: https://github.com/camcam2605/has-props-js/issues
- npm.io page: https://npm.io/package/has-props-js

## Recent versions

- 1.0.2 (latest) — 2023-07-28
- 1.0.1 — 2023-07-27
- 1.0.0 — 2023-07-27

## README

# has-props-js

The library to determines whether an object has the specified properties.

## Installation

```sh
npm i has-props-js
```

or

```sh
yarn add has-props-js
```

## Usage

```js
import hasProps from "has-props-js";

const myObject = { orange: "Orange", lemon: "Lemon", watermelon: "Watermelon" };

hasProps(myObject, "orange"); // true
hasProps(myObject, ["orange", "lemon"]); // true
hasProps(myObject, ["orange", "lemon"], { pick: true }); // false
```

## API

### `hasProps(object, props, options)`

- `object` - `object` (Required) - The object to check
- `props` - `string | number | symbol | any[]` (Required) - The property to check, accept multiple properties as an array
- `options` - `object` (Optional) - `options.pick` option allow the `object` can only contain properties of `props`
- return an `boolean`

---
_Source: https://npm.io/package/has-props-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
