# field-value

> Pair up objects to field-values

Latest version **1.0.1** (published 2016-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install field-value
pnpm add field-value
yarn add field-value
bun add field-value
```

## 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.1 |
| Published | 2016-07-17 |
| First published | 2015-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ragingwind |
| Maintainers | ragingwind |
| Keywords | field-value, field, key-valye, serialize, deserialize, querystring, json |

## Links

- npm: https://www.npmjs.com/package/field-value
- Repository: https://github.com/ragingwind/field-value
- Homepage: https://github.com/ragingwind/field-value#readme
- Issues: https://github.com/ragingwind/field-value/issues
- npm.io page: https://npm.io/package/field-value

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-07-17
- 1.0.0 — 2016-07-17
- 0.2.2 — 2016-07-17
- 0.2.1 — 2016-07-16
- 0.2.0 — 2016-07-16
- 0.1.0 — 2015-12-20

## README

# field-value [![Build Status](https://travis-ci.org/ragingwind/field-value.svg?branch=master)](https://travis-ci.org/ragingwind/field-value)

> Pair up objects to field-values


## Install

```
$ npm install --save field-value
```


## Usage

```js
const fv = require('field-value');

// pair up object to field value pair
fv.pairify({
	'key1': 'value1',
	'key2': 'value2',
	'key3': 'value3',
	'key4': {
		'key4_1': 'value4_1',
		'key4_2': 'value4_2'
	}
});

//=>
[
	'key1="value1"',
	'key2=1',
	'key3=[3,"value3"]',
	'key4={"key4_1":"value4_1","key4_2":"value4_2"}',
]

// parse pairify field value to generate object
fv.parse([
	'key1="value1"',
	'key2=1',
	'key3=[3,"value3"]',
	'key4={"key4_1":"value4_1","key4_2":"value4_2"}',
]);
```


## API

### fieldValue.pairify(object)

Pair up objects to field-value

#### object

Type: object

Object consists of both of key and value

### fieldValue.parse(fieldValue)

Parse pairify field value to generate object

#### fieldValue

Type: Array or string

Strings pairified up by `field-value`

## Uses

You can see more complex samples in test.js

## Development

Using watch option `-w` to continuous build by babel for compile es2015 source

```js
OPTIONS=-w npm run build
```

## License

MIT © [Jimmy Moon](http://ragingwind.me)

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