Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # fromentries [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
  2. [travis-image]: https://img.shields.io/travis/feross/fromentries/master.svg
  3. [travis-url]: https://travis-ci.org/feross/fromentries
  4. [npm-image]: https://img.shields.io/npm/v/fromentries.svg
  5. [npm-url]: https://npmjs.org/package/fromentries
  6. [downloads-image]: https://img.shields.io/npm/dm/fromentries.svg
  7. [downloads-url]: https://npmjs.org/package/fromentries
  8. [standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
  9. [standard-url]: https://standardjs.com
  10. ### Object.fromEntries() ponyfill (in 6 lines)
  11. ## Install
  12. ```
  13. npm install fromentries
  14. ```
  15. ## Why this package?
  16. Existing polyfill packages (like
  17. [`object.fromentries`](https://github.com/es-shims/Object.fromEntries))
  18. pull in a bunch of dependencies and **adds over 8
  19. KB** to the browser bundle size. This allows them to work in ES3 environments
  20. like IE6, but it's also overkill; almost no one supports IE6 anymore.
  21. I'd rather not ship tons of extra code to website visitors. A polyfill for this
  22. feature can be implemented in a few short lines of code using modern language
  23. features. That's what `fromentries` (this package) does.
  24. This means that `fromentries` only works in evergreen browsers like:
  25. - Chrome
  26. - Firefox
  27. - Edge
  28. - Safari
  29. - Opera
  30. It does not work in browsers like IE11 and older (unless you transpile it first).
  31. ## Usage
  32. ```js
  33. const fromEntries = require('fromentries')
  34. const map = new Map([ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 3 ] ])
  35. const obj = fromEntries(map)
  36. constole.log(obj) // { a: 1, b: 2, c: 3 }
  37. const searchParams = new URLSearchParams('foo=bar&baz=qux')
  38. const obj2 = fromEntries(searchParams)
  39. console.log(obj2) // { foo: 'bar', 'baz': 'qux' }
  40. ```
  41. ## What is a ponyfill?
  42. > A *ponyfill* is almost the same as a polyfill, but not quite. Instead of
  43. > patching functionality for older browsers, a ponyfill provides that
  44. > functionality as a standalone module you can use.
  45. Read more at [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills).
  46. ## See also
  47. - [TC39 proposal for Object.fromEntries](https://github.com/tc39/proposal-object-from-entries)
  48. ## License
  49. MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).