{"id":17922547,"url":"https://github.com/rreverser/stack-displayname","last_synced_at":"2025-09-21T03:31:12.461Z","repository":{"id":16703603,"uuid":"19460343","full_name":"RReverser/stack-displayname","owner":"RReverser","description":"Show custom function names in error stack traces of V8 (Node.js)","archived":false,"fork":false,"pushed_at":"2017-04-12T17:49:09.000Z","size":8,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-30T06:51:36.672Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.org/package/stack-displayname","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RReverser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-05T15:19:32.000Z","updated_at":"2021-06-17T00:48:32.000Z","dependencies_parsed_at":"2022-07-22T00:29:43.807Z","dependency_job_id":null,"html_url":"https://github.com/RReverser/stack-displayname","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RReverser/stack-displayname","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fstack-displayname","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fstack-displayname/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fstack-displayname/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fstack-displayname/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RReverser","download_url":"https://codeload.github.com/RReverser/stack-displayname/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RReverser%2Fstack-displayname/sbom","scorecard":{"id":116921,"data":{"date":"2025-08-11","repo":{"name":"github.com/RReverser/stack-displayname","commit":"bd69b0116bfe4ae9266682f5e3b3bb1e46729349"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T01:33:24.457Z","repository_id":16703603,"created_at":"2025-08-16T01:33:24.458Z","updated_at":"2025-08-16T01:33:24.458Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276189897,"owners_count":25600281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T20:39:44.104Z","updated_at":"2025-09-21T03:31:12.239Z","avatar_url":"https://github.com/RReverser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stack-displayName [![Build Status](https://travis-ci.org/RReverser/stack-displayname.svg?branch=master)](https://travis-ci.org/RReverser/stack-displayname)\n\n\u003e Show custom function names in error stack traces\n\n## Firstly there was idea...\n\n[Chromium](https://code.google.com/p/chromium/issues/detail?id=17356), [Firefox](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/displayName) and [Safari](https://bugs.webkit.org/show_bug.cgi?id=25171) agreed and implemented ability to set custom string as function name via non-standard property `displayName` on function instance.\n\nYou can see those custom names in debugger stack and so easier track source of error in long traces of anonymous functions.\n\nCompare informativeness of error stack traces without and with `displayName` on example of [jBinary](https://github.com/jDataView/jBinary):\n\n![Before vs After](https://cloud.githubusercontent.com/assets/557590/2842369/ca53bed6-d073-11e3-85d9-34c18a53a5e3.png)\n\n### And it's usage was simple\n\n```javascript\nvar f = function () {\n  throw new Error();\n};\n\nf.displayName = \"super puper function\";\n\nf(); // enjoy descriptive stack trace!\n```\n\n### But not in Node.js\n\nSince this property was implemented not in JS core but on level of developer tools, in Node.js you still get something like:\n![before](https://cloud.githubusercontent.com/assets/557590/2879612/77316904-d46c-11e3-806f-4d2ae1d442df.png)\nwhich isn't too descriptive about what, where and why happened.\n\nThis drop-in library stringifies error stack traces in V8 both in browser and Node.js, simulating standard formatting but respecting `displayName` property, so when error occurs, you get stylish stack trace with custom function names (in case of jBinary those are type descriptors and field names being processed):\n\n![after](https://cloud.githubusercontent.com/assets/557590/2879614/7936866c-d46c-11e3-817d-9fd2898a8e51.png)\n\n### More crazy ideas to use this for?\n\nYou can even implement own micro BDD testing framework (example taken from http://mochajs.org/#bdd):\n\n```javascript\nrequire('stack-displayname');\nvar assert = require('assert');\n\nvar describe = it = function (name, callback) {\n  callback.displayName = name;\n  callback();\n};\n\ndescribe('Array', function () {\n  describe('#indexOf()', function () {\n    it('should return -1 when not present', function () {\n      assert.equal([1,2,3].indexOf(4), -2); // wrong!\n    });\n  });\n});\n```\n\n![bdd error](https://cloud.githubusercontent.com/assets/557590/2881238/cb00f0ea-d480-11e3-9d3a-63a3cd56bb53.png)\n\nAnd it's pretty easy to compose stack trace capture with other transformations.\n\nFor example, in order to filter out non-`displayName` functions:\n\n```javascript\nrequire('stack-displayname');\n\nvar prepareStackTrace = Error.prepareStackTrace;\n\nError.prepareStackTrace = function (err, stack) {\n\treturn prepareStackTrace(err, stack.filter(function (item) {\n\t\treturn item.fun.displayName;\n\t}));\n};\n\n// ... your code ... //\n```\n\n![bdd error only](https://cloud.githubusercontent.com/assets/557590/5085573/e03b60a4-6f1b-11e4-8a0a-70a6dc75c414.png)\n\n## Installation - boring as usual\n\n### In Node.js\n\nSimply install with npm as:\n\n```bash\nnpm install stack-displayname\n```\n\nand require it:\n\n```javascript\nrequire('stack-displayname');\n```\n\n### In Browser\n\nThis script might be useful only in Chromium, where DevTools already respect `displayName`, but in the case you want to have custom function names in `err.stack` property of any `Error` instances (that's not natively supported), it's possible - just include script on the page via regular tag:\n\n```html\n\u003cscript src=\"stack-displayname/displayName.js\"\u003e\u003c/script\u003e\n```\n\nNon-supported browsers will just ignore it and show stack traces as usual.\n\n## License\n\nCopyright 2014 Ingvar Stepanyan\n\nCopyright 2006-2011, the V8 project authors. All rights reserved.\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials provided\n      with the distribution.\n    * Neither the name of Google Inc. nor the names of its\n      contributors may be used to endorse or promote products derived\n      from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frreverser%2Fstack-displayname","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frreverser%2Fstack-displayname","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frreverser%2Fstack-displayname/lists"}