https://github.com/lamansky/own-entries
[Node.js] Like Object.entries(), but includes non-enumerable properties, analogous to Reflect.ownKeys()
https://github.com/lamansky/own-entries
Last synced: 3 months ago
JSON representation
[Node.js] Like Object.entries(), but includes non-enumerable properties, analogous to Reflect.ownKeys()
- Host: GitHub
- URL: https://github.com/lamansky/own-entries
- Owner: lamansky
- License: mit
- Created: 2018-03-06T09:14:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-13T08:36:40.000Z (about 8 years ago)
- Last Synced: 2025-10-28T09:55:01.650Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# own-entries
Like `Object.entries()`, but includes non-enumerable properties, analogous to `Reflect.ownKeys()`.
## Installation
Requires [Node.js](https://nodejs.org/) 6.0.0 or above.
```bash
npm i own-entries
```
## API
The module exports a single function.
### Parameter
`obj` (object)
### Return Value
An array of two-element key-value pair arrays.
## Example
```javascript
const ownEntries = require('own-entries')
ownEntries({key: 'value'}) // [['key', 'value']]
```
## Related
* [own-values](https://github.com/lamansky/own-values): The “values” version of this module.
* [entries-array](https://github.com/lamansky/entries-array) / [entries-iterator](https://github.com/lamansky/entries-iterator): Returns an array/iterator of the key-value pairs of an Object, Map, Array, or Typed Array.