An open API service indexing awesome lists of open source software.

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]...]

Awesome Lists containing this project

README

          

# object-pairs [![Build Status][travis-badge]][travis] [![Dependency Status][david-badge]][david]

[![npm](https://nodei.co/npm/object-pairs.png)](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