# fromentries

> Object.fromEntries() ponyfill (in 6 lines)

Latest version **1.3.2** (published 2020-11-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.2 |
| Published | 2020-11-04 |
| First published | 2018-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 69 |
| Author | Feross Aboukhadijeh |
| Maintainers | feross |
| Keywords | Object.fromEntries, Object.entries, Object.values, Object.keys, entries, values, fromEntries, ES7, ES8, shim, object, keys, polyfill, ponyfill |

## Links

- npm: https://www.npmjs.com/package/fromentries
- Repository: https://github.com/feross/fromentries
- Issues: https://github.com/feross/fromentries/issues
- Funding: https://github.com/sponsors/feross
- npm.io page: https://npm.io/package/fromentries

## Recent versions

- 1.3.2 (latest) — 2020-11-04
- 1.3.1 — 2020-10-27
- 1.3.0 — 2020-10-21
- 1.2.1 — 2020-07-17
- 1.2.0 — 2019-08-10
- 1.1.0 — 2018-09-12
- 1.0.3 — 2018-06-21
- 1.0.2 — 2018-06-21
- 1.0.1 — 2018-06-21
- 1.0.0 — 2018-06-21

## README

# fromentries [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[travis-image]: https://img.shields.io/travis/feross/fromentries/master.svg
[travis-url]: https://travis-ci.org/feross/fromentries
[npm-image]: https://img.shields.io/npm/v/fromentries.svg
[npm-url]: https://npmjs.org/package/fromentries
[downloads-image]: https://img.shields.io/npm/dm/fromentries.svg
[downloads-url]: https://npmjs.org/package/fromentries
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Object.fromEntries() ponyfill (in 6 lines)

## Install

```
npm install fromentries
```

## Why this package?

Existing polyfill packages (like
[`object.fromentries`](https://github.com/es-shims/Object.fromEntries))
pull in a bunch of dependencies and **adds over 8
KB** to the browser bundle size. This allows them to work in ES3 environments
like IE6, but it's also overkill; almost no one supports IE6 anymore.

I'd rather not ship tons of extra code to website visitors. A polyfill for this
feature can be implemented in a few short lines of code using modern language
features. That's what `fromentries` (this package) does.

This means that `fromentries` only works in evergreen browsers like:

- Chrome
- Firefox
- Edge
- Safari
- Opera

It does not work in browsers like IE11 and older (unless you transpile it first).

## Usage

```js
const fromEntries = require('fromentries')

const map = new Map([ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 3 ] ])
const obj = fromEntries(map)
constole.log(obj) // { a: 1, b: 2, c: 3 }

const searchParams = new URLSearchParams('foo=bar&baz=qux')
const obj2 = fromEntries(searchParams)
console.log(obj2) // { foo: 'bar', 'baz': 'qux' }
```

## What is a ponyfill?

> A *ponyfill* is almost the same as a polyfill, but not quite. Instead of
> patching functionality for older browsers, a ponyfill provides that
> functionality as a standalone module you can use.

Read more at [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills).

## See also

- [TC39 proposal for Object.fromEntries](https://github.com/tc39/proposal-object-from-entries)

## License

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).

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