{"name":"fromentries","description":"Object.fromEntries() ponyfill (in 6 lines)","version":"1.3.0","author":{"name":"Feross Aboukhadijeh","email":"feross@feross.org","url":"https://feross.org"},"bugs":{"url":"https://github.com/feross/fromentries/issues"},"devDependencies":{"standard":"*","tape":"^5.0.1"},"homepage":"https://github.com/feross/fromentries","keywords":["Object.fromEntries","Object.entries","Object.values","Object.keys","entries","values","fromEntries","ES7","ES8","shim","object","keys","polyfill","ponyfill"],"license":"MIT","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git://github.com/feross/fromentries.git"},"scripts":{"test":"standard && tape test/**/*.js"},"funding":[{"type":"github","url":"https://github.com/sponsors/feross"},{"type":"patreon","url":"https://www.patreon.com/feross"},{"type":"consulting","url":"https://feross.org/support"}],"gitHead":"7df43c7d1643b3abfa4f8ea2dd042c50b3e6a13a","_id":"fromentries@1.3.0","_nodeVersion":"14.14.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+pKvlQHvpxxSTF+tWZ4DjxD0Sz4G26EjAP4z7D2k8VLJ19hrLbSgaQLx/u2mVQn7hiA2s/3DyutOyFwTuDsRgA==","shasum":"508bd33f0d704a836c9b18e05df59792c82668bc","tarball":"http://registry-npm.ywwl.com/fromentries/download/fromentries-1.3.0.tgz","fileCount":5,"unpackedSize":4980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkJA5CRA9TVsSAnZWagAAfj0P/0Et+6cndyBU2B9fDj9m\naEn70XM2BX/DCajdUAAnasyU42usLER2DP/eW9a5E0jtsODhSSVSkyrvblAe\n2x7+XwEuymYr6DcckEXdCYOQA/RCYjlL33V2EwI5LBP/SiuVxzYbUNTih2j+\nXb2EfcDi6YG8sOrAk8ELKScSN2azLde89qw2pBYn6TRSDYeqnhjFK08VGW9+\nbwDsQMu0Rz/DC7ycGGuZoVDef2myiL+LDJ9QnUWEDvQkIOg7vHGqFMf2ZccL\nktBZTAb5UVke6iHoyDQs/IlcsNrVOijWAqHCHwZaPFGqxLi6T3PP2cKRybgp\nqzXg2ShoWXeg44nauXktKz3DjhoI1Mchx0Vx4TTEqkI/tp1KbOX451RCsPgj\nh1KRbAX731Hcm6cKek7oLQvTpty9OXwOZxwq+uCOeK5v19DCXpt3TwVAcEaO\nWPuXeIVKxffcU8bTVT1SEYxaFfff1vV3b8NJYe8u8jupSDLZ08eJ1Vg14BTT\nI8P1MUIBzPdjZZFop8Ngz9DRxXTrVPkZAbMAQAOuvows6+5G6rxfNqJxIaWa\nJieRiwPIUhaApLhnvMP78loxdrmH20+D7UCqUADMhWcW858ZBS63UVFMbWIy\n2fvyWtuAEhbH2jEcmWk5/nbZXPTDnxWEYZpLaN3w/l38tacphQtdHlkWRekK\nr6KO\r\n=CH95\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHvbx6IXk/z84RsU+L88FbogEZu+PzYhLsLP2OXfy1zCAiAb7ong3+EDXmqcQO89EpRymy5fDDL9woVIuH8jzhI8pA=="}],"size":2510,"noattachment":false,"key":"/fromentries/-/fromentries-1.3.0.tgz"},"maintainers":[{"name":"feross","email":"feross@feross.org"}],"_npmUser":{"name":"feross","email":"feross@feross.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fromentries_1.3.0_1603309624558_0.12860778323351774"},"_hasShrinkwrap":false,"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&baz=qux')\nconst obj2 = fromEntries(searchParams)\nconsole.log(obj2) // { foo: 'bar', 'baz': 'qux' }\n```\n\n## What is a ponyfill?\n\n> A *ponyfill* is almost the same as a polyfill, but not quite. Instead of\n> patching functionality for older browsers, a ponyfill provides that\n> 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","publish_time":1603309624681,"_cnpm_publish_time":1603309624681,"dist-tags":{"latest":"1.3.2"}}