{"id":16399352,"url":"https://github.com/diokuz/syntax-error-stack","last_synced_at":"2026-05-14T22:04:51.424Z","repository":{"id":66183162,"uuid":"170275100","full_name":"Diokuz/syntax-error-stack","owner":"Diokuz","description":"Just better syntax error log for nodejs.","archived":false,"fork":false,"pushed_at":"2019-11-11T10:35:56.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-04T23:22:08.034Z","etag":null,"topics":["callstack","error-handling","nodejs","syntax"],"latest_commit_sha":null,"homepage":"","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/Diokuz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-12T07:48:28.000Z","updated_at":"2019-11-11T10:35:58.000Z","dependencies_parsed_at":"2023-02-26T19:01:25.988Z","dependency_job_id":null,"html_url":"https://github.com/Diokuz/syntax-error-stack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diokuz%2Fsyntax-error-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diokuz%2Fsyntax-error-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diokuz%2Fsyntax-error-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Diokuz%2Fsyntax-error-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Diokuz","download_url":"https://codeload.github.com/Diokuz/syntax-error-stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240304705,"owners_count":19780313,"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","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":["callstack","error-handling","nodejs","syntax"],"created_at":"2024-10-11T05:23:55.906Z","updated_at":"2026-05-14T22:04:46.378Z","avatar_url":"https://github.com/Diokuz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Just better syntax error log for nodejs.\n\n## Example\n\na.js\n\n```js\nrequire('./b')\n```\n\nb.js\n\n```js\n! some invalid js, await async yield debugger\n```\n\n### CLI\n\n\u003e it is ignoring ts, tsx, jsx and css file extensions by default\n\n```\nyarn ses examples/simple/a.js\nyarn run v1.17.3\n$ bin/ses.js examples/simple/a.js\nentry:  /Users/d.o.kuznetsov/github/syntax-error-stack/examples/simple/a.js\nfilename /Users/d.o.kuznetsov/github/syntax-error-stack/examples/simple/a.js\nfilename /Users/d.o.kuznetsov/github/syntax-error-stack/examples/simple/b.js\nTotal files number:  2\nTotal loads:         2\n\nBad require chain #1\n  → /Users/d.o.kuznetsov/github/syntax-error-stack/examples/simple/b.js\n...\n```\n\n### JS API\n\n\u003e is not ignoring any extensions by default, use require-hacker or something else\n\nindex.js\n\n```js\nconst ses = require('syntax-error-stack')\n\nses(require.resolve('./a'))\n```\n\nThe result log will be:\n\n```\n$ node examples/simple/index.js\n\nBad require chain #1\n  → /Users/xxx/github/syntax-error-stack/examples/simple/b.js\n  → /Users/xxx/github/syntax-error-stack/examples/simple/a.js\n  → /Users/xxx/github/syntax-error-stack/index.js\n  → .\n\n/Users/xxx/github/syntax-error-stack/examples/simple/b.js:1\n(function (exports, require, module, __filename, __dirname) { ! some invalid js, await async yield debugger\n                                                                     ^^^^^^^\n```\n\n## Explanation\n\nYou can have a huge dependency tree, and only one bad file. It is important to extract not only filename, but full require chain.\n\n`syntax-error-stack` uses non-stable API `Module._compile` and `Module._extensions` – same is used in `require-hacker` module. So, each js-file require is actually wrapped with custom function, which, in case of compile problems, stores errors and full require chains for log.\n\nSee `/index.js` for details – it is not too big/hard to read and understand.\n\nAlso, you could easily count the total number of files in your dependency tree, and list them all via CLI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiokuz%2Fsyntax-error-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiokuz%2Fsyntax-error-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiokuz%2Fsyntax-error-stack/lists"}