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.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # globalThis <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
  2. [![dependency status][deps-svg]][deps-url]
  3. [![dev dependency status][dev-deps-svg]][dev-deps-url]
  4. [![License][license-image]][license-url]
  5. [![Downloads][downloads-image]][downloads-url]
  6. [![npm badge][npm-badge-png]][npm-url]
  7. An ECMAScript spec-compliant polyfill/shim for `globalThis`. Invoke its "shim" method to shim `globalThis` if it is unavailable.
  8. 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 [spec proposal](https://github.com/tc39/proposal-global).
  9. Most common usage:
  10. ```js
  11. var globalThis = require('globalthis')(); // returns native globalThis if compliant
  12. /* or */
  13. var globalThis = require('globalthis/polyfill')(); // returns native globalThis if compliant
  14. ```
  15. ## Example
  16. ```js
  17. var assert = require('assert');
  18. // the below function is not CSP-compliant, but reliably gets the
  19. // global object in sloppy mode in every engine.
  20. var getGlobal = Function('return this');
  21. assert.equal(globalThis, getGlobal());
  22. ```
  23. ```js
  24. /* when `globalThis` is not present */
  25. var shimmedGlobal = require('globalthis').shim();
  26. /* or */
  27. var shimmedGlobal = require('globalthis/shim')();
  28. assert.equal(shimmedGlobal, globalThis);
  29. assert.equal(shimmedGlobal, getGlobal());
  30. ```
  31. ```js
  32. /* when `globalThis` is present */
  33. var shimmedGlobal = require('globalthis').shim();
  34. assert.equal(shimmedGlobal, globalThis);
  35. assert.equal(shimmedGlobal, getGlobal());
  36. ```
  37. ## Tests
  38. Simply clone the repo, `npm install`, and run `npm test`
  39. [npm-url]: https://npmjs.org/package/globalthis
  40. [npm-version-svg]: https://versionbadg.es/ljharb/globalThis.svg
  41. [deps-svg]: https://david-dm.org/ljharb/globalThis.svg?theme=shields.io
  42. [deps-url]: https://david-dm.org/ljharb/globalThis
  43. [dev-deps-svg]: https://david-dm.org/ljharb/globalThis/dev-status.svg?theme=shields.io
  44. [dev-deps-url]: https://david-dm.org/ljharb/globalThis#info=devDependencies
  45. [npm-badge-png]: https://nodei.co/npm/globalthis.png?downloads=true&stars=true
  46. [license-image]: https://img.shields.io/npm/l/globalthis.svg
  47. [license-url]: LICENSE
  48. [downloads-image]: https://img.shields.io/npm/dm/globalthis.svg
  49. [downloads-url]: https://npm-stat.com/charts.html?package=globalthis