# extract-prop

> Delete a property from an object and return it

Latest version **0.1.0** (published 2015-05-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install extract-prop
pnpm add extract-prop
yarn add extract-prop
bun add extract-prop
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-05-14 |
| First published | 2015-05-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Nick Sheffield |
| Maintainers | nicksheffield |
| Keywords | extract, property, object |

## Links

- npm: https://www.npmjs.com/package/extract-prop
- Repository: https://github.com/nicksheffield/extract-prop
- Issues: https://github.com/nicksheffield/extract-prop/issues
- npm.io page: https://npm.io/package/extract-prop

## Recent versions

- 0.1.0 (latest) — 2015-05-14
- 0.0.2 — 2015-05-13
- 0.0.1 — 2015-05-13

## README

# extract-props

Delete a property from an object and return it

## Install

> npm install extract-prop

## Usage

```javascript
var extractProp = require('extract-prop');

var body = {
	name: 'frank',
	email: 'frank@example.com',
	populate: 'posts'
};

// this value exists in the object
var pop = extractProp(body, 'populate');
// this value doesn't exist in the object, but has a fallback value
var order = extractProp(body, 'order', 'default value');
// this value just doesn't exist in the object
var nonexistent = extractProp(body, 'nonexistent');

console.log(body);
/*
	will log: { name: 'frank', email: 'frank@example.com' }
*/

console.log(pop);
/*
	will log: 'posts'
*/

console.log(order);
/*
	will log: 'default value'
*/

console.log(nonexistent);
/*
	will log: undefined
*/
```

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