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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # get-intrinsic <sup>[![Version Badge][npm-version-svg]][package-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]][package-url]
  7. Get and robustly cache all JS language-level intrinsics at first require time.
  8. See the syntax described [in the JS spec](https://tc39.es/ecma262/#sec-well-known-intrinsic-objects) for reference.
  9. ## Example
  10. ```js
  11. var GetIntrinsic = require('get-intrinsic');
  12. var assert = require('assert');
  13. // static methods
  14. assert.equal(GetIntrinsic('%Math.pow%'), Math.pow);
  15. assert.equal(Math.pow(2, 3), 8);
  16. assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8);
  17. delete Math.pow;
  18. assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8);
  19. // instance methods
  20. var arr = [1];
  21. assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push);
  22. assert.deepEqual(arr, [1]);
  23. arr.push(2);
  24. assert.deepEqual(arr, [1, 2]);
  25. GetIntrinsic('%Array.prototype.push%').call(arr, 3);
  26. assert.deepEqual(arr, [1, 2, 3]);
  27. delete Array.prototype.push;
  28. GetIntrinsic('%Array.prototype.push%').call(arr, 4);
  29. assert.deepEqual(arr, [1, 2, 3, 4]);
  30. // missing features
  31. delete JSON.parse; // to simulate a real intrinsic that is missing in the environment
  32. assert.throws(() => GetIntrinsic('%JSON.parse%'));
  33. assert.equal(undefined, GetIntrinsic('%JSON.parse%', true));
  34. ```
  35. ## Tests
  36. Simply clone the repo, `npm install`, and run `npm test`
  37. ## Security
  38. Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
  39. [package-url]: https://npmjs.org/package/get-intrinsic
  40. [npm-version-svg]: http://versionbadg.es/ljharb/get-intrinsic.svg
  41. [deps-svg]: https://david-dm.org/ljharb/get-intrinsic.svg
  42. [deps-url]: https://david-dm.org/ljharb/get-intrinsic
  43. [dev-deps-svg]: https://david-dm.org/ljharb/get-intrinsic/dev-status.svg
  44. [dev-deps-url]: https://david-dm.org/ljharb/get-intrinsic#info=devDependencies
  45. [npm-badge-png]: https://nodei.co/npm/get-intrinsic.png?downloads=true&stars=true
  46. [license-image]: https://img.shields.io/npm/l/get-intrinsic.svg
  47. [license-url]: LICENSE
  48. [downloads-image]: https://img.shields.io/npm/dm/get-intrinsic.svg
  49. [downloads-url]: https://npm-stat.com/charts.html?package=get-intrinsic