https://github.com/abranhe/delete-keys
Remove the keys you don't want from an object
https://github.com/abranhe/delete-keys
javascript module npm object
Last synced: 3 months ago
JSON representation
Remove the keys you don't want from an object
- Host: GitHub
- URL: https://github.com/abranhe/delete-keys
- Owner: abranhe
- License: mit
- Created: 2019-12-16T19:57:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-22T06:24:27.000Z (over 6 years ago)
- Last Synced: 2025-10-30T23:48:49.512Z (9 months ago)
- Topics: javascript, module, npm, object
- Language: JavaScript
- Homepage: https://p.abranhe.com/delete-keys
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
Awesome Lists containing this project
README
# delete-keys
[](https://travis-ci.com/abranhe/delete-keys) [](https://github.com/abranhe/delete-keys/actions) [](https://npmjs.org/delete-keys)
> Remove the keys you don't want from an object
## Install
```
$ npm install delete-keys
```
Using [Github NPM Registry](https://github.com/features/packages)
```
$ npm install abranhe@delete-keys
```
## Usage
```js
import deleteKeys from 'delete-keys';
const obj = {
name: 'abraham',
last: 'hernandez',
_id: '03773',
phone: '800-000-0000',
};
deleteKeys(obj, ['_id', 'phone']);
// {
// name: 'abraham',
// last: 'hernandez',
// }
```
## API
### deleteKeys(object, [keys])
#### object
Type: `object`
The object you would like to delete the keys
#### keys
Type: `array`
## License
MIT © [Abraham Hernandez](https://abranhe.com)