{"id":15552192,"url":"https://github.com/bahmutov/bad-line","last_synced_at":"2026-01-10T23:55:47.648Z","repository":{"id":27185144,"uuid":"30655085","full_name":"bahmutov/bad-line","owner":"bahmutov","description":"Plugin for cute-stack that prints actual bad line for local source files","archived":false,"fork":false,"pushed_at":"2015-03-07T12:38:11.000Z","size":388,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T20:52:18.206Z","etag":null,"topics":["exceptions","node","stack","stack-traces"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bahmutov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T15:44:22.000Z","updated_at":"2017-06-02T14:45:13.000Z","dependencies_parsed_at":"2022-08-17T17:10:44.461Z","dependency_job_id":null,"html_url":"https://github.com/bahmutov/bad-line","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fbad-line","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fbad-line/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fbad-line/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Fbad-line/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/bad-line/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234570385,"owners_count":18854156,"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":["exceptions","node","stack","stack-traces"],"created_at":"2024-10-02T14:11:41.780Z","updated_at":"2025-09-28T23:31:29.939Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bad-line\n\n\u003e Plugin for [cute-stack][cute-stack] that prints bad line for local source files\n\n[![NPM info][nodei.co]](https://npmjs.org/package/bad-line)\n\n[![Build status][ci-image]][ci-url]\n[![dependencies][dependencies-image]][dependencies-url]\n[![devdependencies][bad-line-devdependencies-image] ][bad-line-devdependencies-url]\n\n## Install and use\n\n    npm install --save bad-line\n\nInclude as a plugin for [cute-stack][cute-stack]\n\n```js\nrequire('cute-stack')(require('bad-line'));\n```\n\nor do it in several steps\n\n```js\nvar cute = require('cute-stack');\ncute.ui.badLine = require('bad-line');\ncute('badLine');\n```\n\n## Example\n\nLet us initialize `cute-stack` in one file and then execute a file with an exception.\nYou can see these files in the folder `test`\n\n```js\n// demo.js\nvar cute = require('cute-stack');\ncute.ui.badLine = require('bad-line');\ncute('badLine');\nrequire('./file-with-error');\n// file-with-error.js\nfunction bar() {\n  throw new Error('This is an error!');\n}\nfunction foo() {\n  bar();\n}\nfoo();\n```\n\nThis generates the following output, notice the actual source line contents\n\n![bad-line output](images/bad-line.png)\n\nCompare this with standard output produced by `pretty` formatter for example\n\n![pretty output](images/pretty.png)\n\n`bad-line` prints the actual offending line, not just the function's name.\n\n## Small print\n\nAuthor: Gleb Bahmutov \u0026copy; 2015\n[@bahmutov](https://twitter.com/bahmutov) [glebbahmutov.com](http://glebbahmutov.com)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSpread the word: tweet, star on github, etc.\n\nSupport: if you find any problems with this module, email / tweet / open issue on Github\n\n[ci-image]: https://travis-ci.org/bahmutov/bad-line.png?branch=master\n[ci-url]: https://travis-ci.org/bahmutov/bad-line\n[nodei.co]: https://nodei.co/npm/bad-line.png?downloads=true\n[dependencies-image]: https://david-dm.org/bahmutov/bad-line.png\n[dependencies-url]: https://david-dm.org/bahmutov/bad-line\n[bad-line-devdependencies-image]: https://david-dm.org/bahmutov/bad-line/dev-status.png\n[bad-line-devdependencies-url]: https://david-dm.org/bahmutov/bad-line#info=devDependencies\n\n[cute-stack]: https://github.com/davidmarkclements/cute-stack\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fbad-line","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Fbad-line","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Fbad-line/lists"}