{"id":17399269,"url":"https://github.com/feross/fromentries","last_synced_at":"2025-04-05T05:06:45.894Z","repository":{"id":56482029,"uuid":"138211480","full_name":"feross/fromentries","owner":"feross","description":"Object.fromEntries() ponyfill (in 6 lines)","archived":false,"fork":false,"pushed_at":"2020-11-04T21:51:55.000Z","size":24,"stargazers_count":69,"open_issues_count":1,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-15T12:54:45.753Z","etag":null,"topics":["browser","es6","es7","es8","esnext","fromentries","javascript","nodejs","object","object-fromentries","polyfill","ponyfill"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/feross.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-21T19:06:48.000Z","updated_at":"2023-10-24T10:55:29.000Z","dependencies_parsed_at":"2022-08-15T19:31:36.083Z","dependency_job_id":null,"html_url":"https://github.com/feross/fromentries","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Ffromentries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Ffromentries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Ffromentries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Ffromentries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feross","download_url":"https://codeload.github.com/feross/fromentries/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289428,"owners_count":20914464,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser","es6","es7","es8","esnext","fromentries","javascript","nodejs","object","object-fromentries","polyfill","ponyfill"],"created_at":"2024-10-16T15:14:44.433Z","updated_at":"2025-04-05T05:06:45.877Z","avatar_url":"https://github.com/feross.png","language":"JavaScript","readme":"# fromentries [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[travis-image]: https://img.shields.io/travis/feross/fromentries/master.svg\n[travis-url]: https://travis-ci.org/feross/fromentries\n[npm-image]: https://img.shields.io/npm/v/fromentries.svg\n[npm-url]: https://npmjs.org/package/fromentries\n[downloads-image]: https://img.shields.io/npm/dm/fromentries.svg\n[downloads-url]: https://npmjs.org/package/fromentries\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n### Object.fromEntries() ponyfill (in 6 lines)\n\n## Install\n\n```\nnpm install fromentries\n```\n\n## Why this package?\n\nExisting polyfill packages (like\n[`object.fromentries`](https://github.com/es-shims/Object.fromEntries))\npull in a bunch of dependencies and **adds over 8\nKB** to the browser bundle size. This allows them to work in ES3 environments\nlike IE6, but it's also overkill; almost no one supports IE6 anymore.\n\nI'd rather not ship tons of extra code to website visitors. A polyfill for this\nfeature can be implemented in a few short lines of code using modern language\nfeatures. That's what `fromentries` (this package) does.\n\nThis means that `fromentries` only works in evergreen browsers like:\n\n- Chrome\n- Firefox\n- Edge\n- Safari\n- Opera\n\nIt does not work in browsers like IE11 and older (unless you transpile it first).\n\n## Usage\n\n```js\nconst fromEntries = require('fromentries')\n\nconst map = new Map([ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 3 ] ])\nconst obj = fromEntries(map)\nconstole.log(obj) // { a: 1, b: 2, c: 3 }\n\nconst searchParams = new URLSearchParams('foo=bar\u0026baz=qux')\nconst obj2 = fromEntries(searchParams)\nconsole.log(obj2) // { foo: 'bar', 'baz': 'qux' }\n```\n\n## What is a ponyfill?\n\n\u003e A *ponyfill* is almost the same as a polyfill, but not quite. Instead of\n\u003e patching functionality for older browsers, a ponyfill provides that\n\u003e functionality as a standalone module you can use.\n\nRead more at [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills).\n\n## See also\n\n- [TC39 proposal for Object.fromEntries](https://github.com/tc39/proposal-object-from-entries)\n\n## License\n\nMIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Ffromentries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeross%2Ffromentries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Ffromentries/lists"}