Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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 3.1KB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <h1 align=center>
  2. <a href="http://chaijs.com" title="Chai Documentation">
  3. <img alt="ChaiJS" src="http://chaijs.com/img/chai-logo.png"/>
  4. <br>
  5. get-func-name
  6. </a>
  7. </h1>
  8. <p align=center>
  9. Utility for getting a function's name for <a href="http://nodejs.org">node</a> and the browser.
  10. </p>
  11. <p align=center>
  12. <a href="./LICENSE">
  13. <img
  14. alt="license:mit"
  15. src="https://img.shields.io/badge/license-mit-green.svg?style=flat-square"
  16. />
  17. </a>
  18. <a href="https://github.com/chaijs/get-func-name/releases">
  19. <img
  20. alt="tag:?"
  21. src="https://img.shields.io/github/tag/chaijs/get-func-name.svg?style=flat-square"
  22. />
  23. </a>
  24. <a href="https://travis-ci.org/chaijs/get-func-name">
  25. <img
  26. alt="build:?"
  27. src="https://img.shields.io/travis/chaijs/get-func-name/master.svg?style=flat-square"
  28. />
  29. </a>
  30. <a href="https://coveralls.io/r/chaijs/get-func-name">
  31. <img
  32. alt="coverage:?"
  33. src="https://img.shields.io/coveralls/chaijs/get-func-name/master.svg?style=flat-square"
  34. />
  35. </a>
  36. <a href="https://www.npmjs.com/packages/get-func-name">
  37. <img
  38. alt="npm:?"
  39. src="https://img.shields.io/npm/v/get-func-name.svg?style=flat-square"
  40. />
  41. </a>
  42. <a href="https://www.npmjs.com/packages/get-func-name">
  43. <img
  44. alt="dependencies:?"
  45. src="https://img.shields.io/npm/dm/get-func-name.svg?style=flat-square"
  46. />
  47. </a>
  48. <a href="">
  49. <img
  50. alt="devDependencies:?"
  51. src="https://img.shields.io/david/chaijs/get-func-name.svg?style=flat-square"
  52. />
  53. </a>
  54. <br/>
  55. <a href="https://saucelabs.com/u/chaijs-get-func-name">
  56. <img
  57. alt="Selenium Test Status"
  58. src="https://saucelabs.com/browser-matrix/chaijs-get-func-name.svg"
  59. />
  60. </a>
  61. <br>
  62. <a href="https://chai-slack.herokuapp.com/">
  63. <img
  64. alt="Join the Slack chat"
  65. src="https://img.shields.io/badge/slack-join%20chat-E2206F.svg?style=flat-square"
  66. />
  67. </a>
  68. <a href="https://gitter.im/chaijs/chai">
  69. <img
  70. alt="Join the Gitter chat"
  71. src="https://img.shields.io/badge/gitter-join%20chat-D0104D.svg?style=flat-square"
  72. />
  73. </a>
  74. </p>
  75. ## What is get-func-name?
  76. This is a module to retrieve a function's name securely and consistently both in NodeJS and the browser.
  77. ## Installation
  78. ### Node.js
  79. `get-func-name` is available on [npm](http://npmjs.org). To install it, type:
  80. $ npm install get-func-name
  81. ### Browsers
  82. You can also use it within the browser; install via npm and use the `get-func-name.js` file found within the download. For example:
  83. ```html
  84. <script src="./node_modules/get-func-name/get-func-name.js"></script>
  85. ```
  86. ## Usage
  87. The module `get-func-name` exports the following method:
  88. * `getFuncName(fn)` - Returns the name of a function.
  89. ```js
  90. var getFuncName = require('get-func-name');
  91. ```
  92. #### .getFuncName(fun)
  93. ```js
  94. var getFuncName = require('get-func-name');
  95. var unknownFunction = function myCoolFunction(word) {
  96. return word + 'is cool';
  97. };
  98. var anonymousFunction = (function () {
  99. return function () {};
  100. }());
  101. getFuncName(unknownFunction) // 'myCoolFunction'
  102. getFuncName(anonymousFunction) // ''
  103. ```