# modify-values

> Modify the values of an object

Latest version **2.1.1** (published 2021-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install modify-values
pnpm add modify-values
yarn add modify-values
bun add modify-values
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.1 |
| Published | 2021-09-10 |
| First published | 2015-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | object, assign, extend, properties, values, value, transform, transformation, map, modify |

## Links

- npm: https://www.npmjs.com/package/modify-values
- Repository: https://github.com/sindresorhus/modify-values
- Homepage: https://github.com/sindresorhus/modify-values#readme
- Issues: https://github.com/sindresorhus/modify-values/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/modify-values

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.1.1 (latest) — 2021-09-10
- 2.1.0 — 2021-05-08
- 2.0.0 — 2021-05-03
- 1.0.1 — 2018-03-23
- 1.0.0 — 2015-01-25

## README

# modify-values

> Modify the values of an object

## Install

```
$ npm install modify-values
```

## Usage

```js
import modifyValues from 'modify-values';

modifyValues({foo: 'UNICORN'}, (value, key) => value.toLowerCase());
//=> {foo: 'unicorn'}
```

## API

### modifyValues(object, transformer)

Modifies the values and returns a new object.

#### object

Type: `object`

#### transformer(value, key)

Type: `Function`

Gets the value and key for each item and is expected to return the new value.

## Related

See [`modify-keys`](https://github.com/sindresorhus/modify-keys) for modifying the keys of an object.

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-modify-values?utm_source=npm-modify-values&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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