選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # callstack
  2. Access to v8's "raw" `CallSite`s.
  3. ## Installation
  4. $ npm install callsite
  5. ## Example
  6. ```js
  7. var stack = require('callsite');
  8. foo();
  9. function foo() {
  10. bar();
  11. }
  12. function bar() {
  13. baz();
  14. }
  15. function baz() {
  16. console.log();
  17. stack().forEach(function(site){
  18. console.log(' \033[36m%s\033[90m in %s:%d\033[0m'
  19. , site.getFunctionName() || 'anonymous'
  20. , site.getFileName()
  21. , site.getLineNumber());
  22. });
  23. console.log();
  24. }
  25. ```
  26. ## Why?
  27. Because you can do weird, stupid, clever, wacky things such as:
  28. - [better-assert](https://github.com/visionmedia/better-assert)
  29. ## License
  30. MIT