https://github.com/eush77/object-pairs
Object -> [[key0, value0], [key1, value1]...]
https://github.com/eush77/object-pairs
Last synced: 8 months ago
JSON representation
Object -> [[key0, value0], [key1, value1]...]
- Host: GitHub
- URL: https://github.com/eush77/object-pairs
- Owner: eush77
- License: mit
- Created: 2014-12-12T23:37:06.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-25T18:35:50.000Z (almost 11 years ago)
- Last Synced: 2025-07-18T17:40:17.313Z (9 months ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micro-npm-packages-zh - object-pairs - 将对象转换为[key, value],用于映射,迭代或其他用途. (模块 / 对象)
- awesome-micro-npm-packages - object-pairs - Turn an object into list of [key, value] pairs for mapping, iterating or other purposes. (Modules / Object)
- awesome-micro-npm-packages - object-pairs - Turn an object into list of [key, value] pairs for mapping, iterating or other purposes. (Modules / Object)
- fucking-awesome-micro-npm-packages - object-pairs - Turn an object into list of [key, value] pairs for mapping, iterating or other purposes. (Modules / Object)
README
# object-pairs [![Build Status][travis-badge]][travis] [![Dependency Status][david-badge]][david]
[](https://nodei.co/npm/object-pairs/)
[travis]: https://travis-ci.org/eush77/object-pairs
[travis-badge]: https://travis-ci.org/eush77/object-pairs.svg
[david]: https://david-dm.org/eush77/object-pairs
[david-badge]: https://david-dm.org/eush77/object-pairs.png
Turn an object into list of `[key, value]` pairs for mapping, iterating or other purposes.
## Example
```js
> pairs = require('object-pairs')
[Function]
> pairs({ foo: 2, bar: 4 })
[ [ 'foo', 2 ],
[ 'bar', 4 ] ]
```
## API
### `pairs(obj)`
Return list of key-value pairs.
## See also
- [zipmap] for the opposite transformation.
[zipmap]: https://github.com/landau/zipmap
## Install
```shell
npm install object-pairs
```
## License
MIT