# remove-property

> Removes property of an object

Latest version **1.0.1** (published 2019-12-20) · GNU license · 0 weekly downloads

## Install

```sh
npm install remove-property
pnpm add remove-property
yarn add remove-property
bun add remove-property
```

## 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.1 |
| Published | 2019-12-20 |
| First published | 2019-12-20 |
| Weekly downloads | 0 |
| License | GNU |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 36.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | @flejz |
| Maintainers | flejz |
| Keywords | javascript, json, property, prop, remove, delete |

## Links

- npm: https://www.npmjs.com/package/remove-property
- Repository: https://github.com/flejz/remove-property
- Homepage: https://github.com/flejz/remove-property#readme
- Issues: https://github.com/flejz/remove-property/issues
- npm.io page: https://npm.io/package/remove-property

## Dependencies (1)

- [array-reducer](https://npm.io/package/array-reducer.md) ^1.0.3

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-12-20
- 1.0.0 — 2019-12-20

## README

# remove-property

![file size][shield-size]
![version][shield-release]

[shield-size]: https://img.shields.io/github/size/flejz/remove-property/src/index.js
[shield-release]: https://img.shields.io/github/package-json/v/flejz/remove-property

Create a new object without the unwanted properties from the original one.

Install with:

```sh
npm i remove-property
```

Start requiring and then make the magic happen

```javascript
const flush = require('remove-property')
```

You might need at least 2 arguments, the first one is the object you want to change, the second onwards is the fields you want to remove.

```javascript
flush(obj, param, param1, param2, ..., paramN)
```

* `obj` is your object
* `p+` are strings with the property (key) name to be removed

## Sample

```javascript
const flush = require('remove-property')

const obj = {
  name: 'John Heinz Lopes',
  password: '1234!@#$',
  address: 'Street Calle Rua',
}

const result = flush(obj, 'password', 'address')
// or
const result = flush(obj, ['password', 'address'])
// or
const result = flush(obj, 'password', ['address'])
// or
const result = flush(obj, ...['password', 'address'])


console.log(obj);    // { name: 'John Heinz Lopes', password: '1234!@#$', address: 'Street Calle Rua' }
console.log(result); // { name: 'John Heinz Lopes' }
```

> PS: all array will be flattened

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