# argtoob

> converts arguments to an object

Latest version **1.0.2** (published 2016-02-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install argtoob
pnpm add argtoob
yarn add argtoob
bun add argtoob
```

## 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.2 |
| Published | 2016-02-17 |
| First published | 2016-02-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tushar Mathur |
| Maintainers | tusharmathur |

## Links

- npm: https://www.npmjs.com/package/argtoob
- Repository: https://github.com/tusharmath/argtoob
- Homepage: https://github.com/tusharmath/argtoob#readme
- Issues: https://github.com/tusharmath/argtoob/issues
- npm.io page: https://npm.io/package/argtoob

## Recent versions

- 1.0.2 (latest) — 2016-02-17
- 1.0.1 — 2016-02-17
- 1.0.0 — 2016-02-16

## README

# argtoob

[![Build Status][travis-svg]][travis-build]
[![npm][npm-version-svg]][npm]

Function to convert a list of arguments to an object. This module is created as an alternative to the request [lodash#2004][0] and of course with @jdalton's permission :-)

## Install

```bash
npm i argtoob --save
```

## Usage
```javascript
const targs = require('argtoob')

const toObj = targs('a', 'b', 'c') // returns a function

toObj(1, 2, 3) // returns {a: 1, b: 2, c: 3}

```

## Examples

#### 1. Create a key value pair from an object

```javascript
const _ = require('lodash')
const targs = require('argtoob')

_.map({a: 1, b: 2, c: 3}, targs('value', 'key'))

/* OUTPUTS
  [
    {key: 'a', value: 1},
    {key: 'b', value: 2},
    {key: 'c', value: 3}
  ]
*/
```

#### 2. Merge Streams with RxJS

```javascript
const Rx = require('rx')
const targs = require('argtoob')
const resize = Rx.Observable.fromEvent(window, 'resize')
const scroll = Rx.Observable.fromEvent(window, 'scroll')

Rx.Observable.combineLatest(resize, scroll, targs('resize', 'scroll'))
```

[0]: https://github.com/lodash/lodash/issues/2004#issuecomment-185087141
[travis-svg]: https://travis-ci.org/tusharmath/argtoob.svg?branch=master
[travis-build]: https://travis-ci.org/tusharmath/argtoob
[npm-version-svg]: https://img.shields.io/npm/v/argtoob.svg
[npm]: https://www.npmjs.com/package/argtoob

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