# object.fromentries

> ES proposal-spec-compliant Object.fromEntries shim.

Latest version **2.0.8** (published 2024-03-18) · MIT license · 0 weekly downloads

> **Native alternative:** Object.fromEntries — Use native JavaScript (Node 12.0.0+) (https://developer.mozilla.orgGlobal_Objects/Object/fromEntries)

## Install

```sh
npm install object.fromentries
pnpm add object.fromentries
yarn add object.fromentries
bun add object.fromentries
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.8 |
| Published | 2024-03-18 |
| First published | 2018-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/object.fromentries) |
| Module format | CommonJS |
| Node | >= 0.4 |
| Dependencies | 4 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Jordan Harband |
| Maintainers | ljharb |
| Keywords | Object.fromEntries, Object.entries, Object.values, Object.keys, entries, values, ES7, ES8, ES2017, shim, object, keys, polyfill, es-shim API |

## Links

- npm: https://www.npmjs.com/package/object.fromentries
- Repository: https://github.com/es-shims/Object.fromEntries
- Homepage: https://github.com/es-shims/Object.fromEntries#readme
- Issues: https://github.com/es-shims/Object.fromEntries/issues
- Funding: https://github.com/sponsors/ljharb
- npm.io page: https://npm.io/package/object.fromentries

## Dependencies (4)

- [call-bind](https://npm.io/package/call-bind.md) ^1.0.7
- [es-abstract](https://npm.io/package/es-abstract.md) ^1.23.2
- [es-object-atoms](https://npm.io/package/es-object-atoms.md) ^1.0.0
- [define-properties](https://npm.io/package/define-properties.md) ^1.2.1

## Recent versions

- 2.0.8 (latest) — 2024-03-18
- 2.0.7 — 2023-08-29
- 2.0.6 — 2022-11-06
- 2.0.5 — 2021-10-03
- 2.0.4 — 2021-02-21
- 2.0.3 — 2020-11-27
- 2.0.2 — 2019-12-12
- 2.0.1 — 2019-10-03
- 2.0.0 — 2018-08-09
- 1.0.0 — 2018-04-04
- 0.0.1-security — 2018-04-04

## README

# object.fromentries <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

An ES spec-proposal-compliant `Object.fromEntries` shim. Invoke its "shim" method to shim `Object.fromEntries` if it is unavailable or noncompliant.

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [proposed spec](https://tc39.github.io/proposal-object-from-entries/).

Most common usage:
```js
var assert = require('assert');
var fromEntries = require('object.fromentries');

var obj = { a: 1, b: 2, c: 3 };
var actual = fromEntries(Object.entries(obj));

assert.deepEqual(obj, actual);

if (!Object.fromEntries) {
	fromEntries.shim();
}

assert.deepEqual(Object.fromEntries(Object.entries(obj)), obj);
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[package-url]: https://npmjs.com/package/object.fromentries
[npm-version-svg]: https://versionbadg.es/es-shims/Object.fromEntries.svg
[deps-svg]: https://david-dm.org/es-shims/Object.fromEntries.svg
[deps-url]: https://david-dm.org/es-shims/Object.fromEntries
[dev-deps-svg]: https://david-dm.org/es-shims/Object.fromEntries/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Object.fromEntries#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/object.fromentries.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/object.fromentries.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/object.fromentries.svg
[downloads-url]: https://npm-stat.com/charts.html?package=object.fromentries
[codecov-image]: https://codecov.io/gh/es-shims/Object.fromEntries/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Object.fromEntries/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Object.fromEntries
[actions-url]: https://github.com/es-shims/Object.fromEntries/actions

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